Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1079)

Unified Diff: chrome/test/data/layout_tests/layout_test_controller.html

Issue 159720: Run the DOM Storage layout tests in the UI test framework since the test shel... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome.gyp ('k') | chrome/test/data/workers/layout_test_controller.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/layout_tests/layout_test_controller.html
===================================================================
--- chrome/test/data/layout_tests/layout_test_controller.html (revision 0)
+++ chrome/test/data/layout_tests/layout_test_controller.html (working copy)
@@ -1,12 +1,26 @@
<script>
function LayoutTestController() {
+ this.wait_until_done_ = false;
this.dumpAsText = function () { };
- this.waitUntilDone = function () { };
+ this.waitUntilDone = function () {
+ this.wait_until_done_ = true;
+ };
this.notifyDone = function () {
var cookie = "%COOKIE%=" + encodeURIComponent(document.firstChild.innerText);
document.cookie = cookie;
};
+ this.OnTimerEvent = function () {
+ // Some layout tests do not call waitUntilDone. If this is true, we should
+ // assume the test is done when it's finished loading.
+ if (!this.wait_until_done_)
+ layoutTestController.notifyDone();
+ };
+ this.OnLoadEvent = function (event) {
+ // Do a timeout to ensure that we run after all other onload handlers have
+ // finished.
+ setTimeout(layoutTestController.OnTimerEvent, 0);
+ };
}
-var layoutTestController = new LayoutTestController();
-window.layoutTestController = layoutTestController;
+window.layoutTestController = new LayoutTestController();
+window.addEventListener('load', layoutTestController.OnLoadEvent, false);
</script>
« no previous file with comments | « chrome/chrome.gyp ('k') | chrome/test/data/workers/layout_test_controller.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698