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

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

Issue 9820005: Move PathService's DIR_LAYOUT_TESTS from chrome to content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove indexed_db_uitest changes Created 8 years, 9 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/test/data/layout_tests/clear_dom_storage.html ('k') | chrome/test/ui/ppapi_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <script>
2 function LayoutTestController() {
3 this.dump_as_text_ = false;
4 this.wait_until_done_ = false;
5
6 this.dumpAsText = function () {
7 this.dump_as_text_ = true;
8 };
9
10 this.waitUntilDone = function () {
11 this.wait_until_done_ = true;
12 };
13
14 this.notifyDone = function () {
15 // For storage events, it actually takes 2 rounds of yielding for everything
16 // to complete.
17 setTimeout(layoutTestController.DelayedNotifyDone1, 0);
18 };
19
20 this.overridePreference = function () {
21 // WebSocket tests call this function by preference name
22 // 'WebKitHixie76WebSocketProtocolEnabled' to switch its protocol version.
23 // In Chromium, the value must be 0 because it doesn't support old one.
24 };
25
26 this.DelayedNotifyDone1 = function () {
27 setTimeout(layoutTestController.DelayedNotifyDone2, 0);
28 };
29
30 this.DelayedNotifyDone2 = function () {
31 var token = encodeURIComponent(document.body.innerText);
32 var limit = 4090;
33 if (token.length > limit)
34 token = encodeURIComponent("Too Big! encoded innerText size was " +
35 token.length + " > " + limit);
36 document.cookie = "%COOKIE%=" + token;
37 };
38
39 this.OnEvent = function () {
40 // HACK: dumpAsText() is always called after waitUntilDone() and all tests
41 // that are run within the UI test framework either call
42 // waitUntilDone() or dumpAsText(). So we'll simply keep polling
43 // until we see one or the other.
44 if (layoutTestController.dump_as_text_) {
45 if (!layoutTestController.wait_until_done_)
46 layoutTestController.notifyDone();
47 } else {
48 setTimeout(layoutTestController.OnEvent, 200);
49 }
50 };
51 }
52
53 window.layoutTestController = new LayoutTestController();
54 window.addEventListener('load', layoutTestController.OnEvent, false);
55 </script>
OLDNEW
« no previous file with comments | « chrome/test/data/layout_tests/clear_dom_storage.html ('k') | chrome/test/ui/ppapi_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698