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

Side by Side Diff: chrome/worker/worker_uitest.cc

Issue 390017: Added lifecycle management and sharing support for SharedWorkers. SharedWorkers (Closed)
Patch Set: Changed WebWorkerBase not not call a virtual function from the destructor Created 11 years, 1 month 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/string_util.h" 5 #include "base/string_util.h"
6 #include "chrome/browser/worker_host/worker_service.h" 6 #include "chrome/browser/worker_host/worker_service.h"
7 #include "chrome/common/chrome_switches.h" 7 #include "chrome/common/chrome_switches.h"
8 #include "chrome/test/automation/browser_proxy.h" 8 #include "chrome/test/automation/browser_proxy.h"
9 #include "chrome/test/automation/tab_proxy.h" 9 #include "chrome/test/automation/tab_proxy.h"
10 #include "chrome/test/ui/ui_layout_test.h" 10 #include "chrome/test/ui/ui_layout_test.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 resource_dir = resource_dir.AppendASCII("resources"); 112 resource_dir = resource_dir.AppendASCII("resources");
113 AddResourceForLayoutTest(js_dir, resource_dir); 113 AddResourceForLayoutTest(js_dir, resource_dir);
114 114
115 for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i) 115 for (size_t i = 0; i < arraysize(kLayoutTestFiles); ++i)
116 RunLayoutTest(kLayoutTestFiles[i], false); 116 RunLayoutTest(kLayoutTestFiles[i], false);
117 } 117 }
118 118
119 TEST_F(WorkerTest, SharedWorkerFastLayoutTests) { 119 TEST_F(WorkerTest, SharedWorkerFastLayoutTests) {
120 static const char* kLayoutTestFiles[] = { 120 static const char* kLayoutTestFiles[] = {
121 "shared-worker-constructor.html", 121 "shared-worker-constructor.html",
122 // Enable remaining SharedWorker tests when functionality is
123 // complete (http://crbug.com/26899)
124 "shared-worker-context-gc.html", 122 "shared-worker-context-gc.html",
125 "shared-worker-event-listener.html", 123 "shared-worker-event-listener.html",
126 //"shared-worker-exception.html", 124 "shared-worker-exception.html",
125 "shared-worker-gc.html",
126 // Lifecycle tests rely on layoutTestController.workerThreadCount which is
127 // not currently implemented.
127 //"shared-worker-frame-lifecycle.html", 128 //"shared-worker-frame-lifecycle.html",
128 "shared-worker-gc.html",
129 //"shared-worker-lifecycle.html", 129 //"shared-worker-lifecycle.html",
130 "shared-worker-load-error.html", 130 "shared-worker-load-error.html",
131 "shared-worker-location.html", 131 "shared-worker-location.html",
132 //"shared-worker-name.html", 132 "shared-worker-name.html",
133 "shared-worker-navigator.html", 133 "shared-worker-navigator.html",
134 "shared-worker-replace-global-constructor.html", 134 "shared-worker-replace-global-constructor.html",
135 "shared-worker-replace-self.html", 135 "shared-worker-replace-self.html",
136 "shared-worker-script-error.html", 136 "shared-worker-script-error.html",
137 //"shared-worker-shared.html", 137 "shared-worker-shared.html",
138 "shared-worker-simple.html", 138 "shared-worker-simple.html",
139 }; 139 };
140 140
141 FilePath fast_test_dir; 141 FilePath fast_test_dir;
142 fast_test_dir = fast_test_dir.AppendASCII("LayoutTests"); 142 fast_test_dir = fast_test_dir.AppendASCII("LayoutTests");
143 fast_test_dir = fast_test_dir.AppendASCII("fast"); 143 fast_test_dir = fast_test_dir.AppendASCII("fast");
144 144
145 FilePath worker_test_dir; 145 FilePath worker_test_dir;
146 worker_test_dir = worker_test_dir.AppendASCII("workers"); 146 worker_test_dir = worker_test_dir.AppendASCII("workers");
147 InitializeForLayoutTest(fast_test_dir, worker_test_dir, false); 147 InitializeForLayoutTest(fast_test_dir, worker_test_dir, false);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 window->AppendTab(url); 294 window->AppendTab(url);
295 295
296 // Check that we didn't create more than the max number of workers. 296 // Check that we didn't create more than the max number of workers.
297 ASSERT_TRUE(WaitForProcessCountToBe(tab_count, total_workers)); 297 ASSERT_TRUE(WaitForProcessCountToBe(tab_count, total_workers));
298 298
299 // Now close a page and check that the queued workers were started. 299 // Now close a page and check that the queued workers were started.
300 tab->NavigateToURL(GetTestUrl(L"google", L"google.html")); 300 tab->NavigateToURL(GetTestUrl(L"google", L"google.html"));
301 301
302 ASSERT_TRUE(WaitForProcessCountToBe(tab_count, total_workers)); 302 ASSERT_TRUE(WaitForProcessCountToBe(tab_count, total_workers));
303 } 303 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698