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

Side by Side Diff: chrome/test/data/layout_tests/layout_test_controller.html

Issue 2879003: Run appcache layout tests in chrome using the ui test harness. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/ui/ui_layout_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <script> 1 <script>
2 function LayoutTestController() { 2 function LayoutTestController() {
3 this.dump_as_text_ = false; 3 this.dump_as_text_ = false;
4 this.wait_until_done_ = false; 4 this.wait_until_done_ = false;
5 5
6 this.dumpAsText = function () { 6 this.dumpAsText = function () {
7 this.dump_as_text_ = true; 7 this.dump_as_text_ = true;
8 }; 8 };
9 9
10 this.waitUntilDone = function () { 10 this.waitUntilDone = function () {
11 this.wait_until_done_ = true; 11 this.wait_until_done_ = true;
12 }; 12 };
13 13
14 this.notifyDone = function () { 14 this.notifyDone = function () {
15 // For storage events, it actually takes 2 rounds of yielding for everything 15 // For storage events, it actually takes 2 rounds of yielding for everything
16 // to complete. 16 // to complete.
17 setTimeout(layoutTestController.DelayedNotifyDone1, 0); 17 setTimeout(layoutTestController.DelayedNotifyDone1, 0);
18 }; 18 };
19 19
20 this.DelayedNotifyDone1 = function () { 20 this.DelayedNotifyDone1 = function () {
21 setTimeout(layoutTestController.DelayedNotifyDone2, 0); 21 setTimeout(layoutTestController.DelayedNotifyDone2, 0);
22 }; 22 };
23 23
24 this.DelayedNotifyDone2 = function () { 24 this.DelayedNotifyDone2 = function () {
25 var token = encodeURIComponent(document.firstChild.innerText); 25 var token = encodeURIComponent(document.body.innerText);
26 document.cookie = "%COOKIE%=" + token; 26 document.cookie = "%COOKIE%=" + token;
27 }; 27 };
28 28
29 this.OnEvent = function () { 29 this.OnEvent = function () {
30 // HACK: dumpAsText() is always called after waitUntilDone() and all tests 30 // HACK: dumpAsText() is always called after waitUntilDone() and all tests
31 // that are run within the UI test framework either call 31 // that are run within the UI test framework either call
32 // waitUntilDone() or dumpAsText(). So we'll simply keep polling 32 // waitUntilDone() or dumpAsText(). So we'll simply keep polling
33 // until we see one or the other. 33 // until we see one or the other.
34 if (layoutTestController.dump_as_text_) { 34 if (layoutTestController.dump_as_text_) {
35 if (!layoutTestController.wait_until_done_) 35 if (!layoutTestController.wait_until_done_)
36 layoutTestController.notifyDone(); 36 layoutTestController.notifyDone();
37 } else { 37 } else {
38 setTimeout(layoutTestController.OnEvent, 200); 38 setTimeout(layoutTestController.OnEvent, 200);
39 } 39 }
40 }; 40 };
41 } 41 }
42 42
43 window.layoutTestController = new LayoutTestController(); 43 window.layoutTestController = new LayoutTestController();
44 window.addEventListener('load', layoutTestController.OnEvent, false); 44 window.addEventListener('load', layoutTestController.OnEvent, false);
45 </script> 45 </script>
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/ui/ui_layout_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698