-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rearrange test folder for dual-mode tests (js/html)
- Loading branch information
Scott J. Miles
committed
Apr 8, 2013
1 parent
aec3e06
commit da9c81b
Showing
12 changed files
with
93 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright 2013 The Toolkitchen Authors. All rights reserved. | ||
* Use of this source code is governed by a BSD-style | ||
* license that can be found in the LICENSE file. | ||
*/ | ||
|
||
// if standalone | ||
if (window.top === window) { | ||
window.done = function() { | ||
alert('Test Passed'); | ||
} | ||
window.onerror = function(x) { | ||
alert('Test FAILED: ' + x); | ||
}; | ||
} else | ||
// if part of a test suite | ||
{ | ||
window.done = function() { | ||
top.postMessage('ok', '*'); | ||
} | ||
window.onerror = function(x) { | ||
top.postMessage(x, '*'); | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright 2013 The Toolkitchen Authors. All rights reserved. | ||
* Use of this source code is governed by a BSD-style | ||
* license that can be found in the LICENSE file. | ||
*/ | ||
|
||
(function() { | ||
var listener, next, iframe; | ||
|
||
function htmlSetup() { | ||
listener = window.addEventListener("message", function(event) { | ||
if (event.data === 'ok') { | ||
next(); | ||
} else { | ||
throw event.data; | ||
} | ||
}); | ||
iframe = document.createElement('iframe'); | ||
iframe.style.cssText = 'position: absolute; left: -9000em; width:768px; height: 1024px'; | ||
document.body.appendChild(iframe); | ||
} | ||
|
||
function htmlTeardown() { | ||
window.removeEventListener(listener); | ||
document.body.removeChild(iframe); | ||
} | ||
|
||
function htmlTest(src) { | ||
test(src, function(done) { | ||
next = done; | ||
iframe.src = src + "?" + Math.random(); | ||
}); | ||
}; | ||
|
||
function htmlSuite(inName, inFn) { | ||
suite('bindProperties-declarative', function() { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
setup(htmlSetup); | ||
teardown(htmlTeardown); | ||
inFn(); | ||
}); | ||
}; | ||
|
||
window.htmlTest = htmlTest; | ||
window.htmlSuite = htmlSuite; | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use inName in call to suite