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

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

Issue 113722: Make automation proxy objects to ref_counted. That allows to process async no... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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/url_fetch_test/url_fetch_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/common/chrome_switches.h" 5 #include "chrome/common/chrome_switches.h"
6 #include "chrome/test/automation/tab_proxy.h" 6 #include "chrome/test/automation/tab_proxy.h"
7 #include "chrome/test/ui/ui_test.h" 7 #include "chrome/test/ui/ui_test.h"
8 8
9 const char kTestCompleteCookie[] = "status"; 9 const char kTestCompleteCookie[] = "status";
10 const char kTestCompleteSuccess[] = "OK"; 10 const char kTestCompleteSuccess[] = "OK";
11 const int kTestIntervalMs = 250; 11 const int kTestIntervalMs = 250;
12 const int kTestWaitTimeoutMs = 30 * 1000; 12 const int kTestWaitTimeoutMs = 30 * 1000;
13 13
14 class WorkerTest : public UITest { 14 class WorkerTest : public UITest {
15 protected: 15 protected:
16 WorkerTest() : UITest() { 16 WorkerTest() : UITest() {
17 launch_arguments_.AppendSwitch(switches::kEnableWebWorkers); 17 launch_arguments_.AppendSwitch(switches::kEnableWebWorkers);
18 } 18 }
19 19
20 void RunTest(const std::wstring& test_case) { 20 void RunTest(const std::wstring& test_case) {
21 scoped_ptr<TabProxy> tab(GetActiveTab()); 21 scoped_refptr<TabProxy> tab(GetActiveTab());
22 22
23 GURL url = GetTestUrl(L"workers", test_case); 23 GURL url = GetTestUrl(L"workers", test_case);
24 ASSERT_TRUE(tab->NavigateToURL(url)); 24 ASSERT_TRUE(tab->NavigateToURL(url));
25 25
26 std::string value = WaitUntilCookieNonEmpty(tab.get(), url, 26 std::string value = WaitUntilCookieNonEmpty(tab.get(), url,
27 kTestCompleteCookie, kTestIntervalMs, kTestWaitTimeoutMs); 27 kTestCompleteCookie, kTestIntervalMs, kTestWaitTimeoutMs);
28 ASSERT_STREQ(kTestCompleteSuccess, value.c_str()); 28 ASSERT_STREQ(kTestCompleteSuccess, value.c_str());
29 } 29 }
30 }; 30 };
31 31
32 TEST_F(WorkerTest, SingleWorker) { 32 TEST_F(WorkerTest, SingleWorker) {
33 RunTest(L"single_worker.html"); 33 RunTest(L"single_worker.html");
34 } 34 }
35 35
36 TEST_F(WorkerTest, MultipleWorkers) { 36 TEST_F(WorkerTest, MultipleWorkers) {
37 RunTest(L"multi_worker.html"); 37 RunTest(L"multi_worker.html");
38 } 38 }
39 39
OLDNEW
« no previous file with comments | « chrome/test/url_fetch_test/url_fetch_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698