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

Side by Side Diff: chrome/test/interactive_ui/infobars_uitest.cc

Issue 3034038: GTTF: Move more test server code from net/url_request/url_request_unittest.h (Closed)
Patch Set: hopefully final Created 10 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 unified diff | Download patch
« no previous file with comments | « chrome/test/in_process_browser_test.cc ('k') | chrome/test/live_sync/live_sync_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 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/test/automation/browser_proxy.h" 5 #include "chrome/test/automation/browser_proxy.h"
6 #include "chrome/test/automation/extension_proxy.h" 6 #include "chrome/test/automation/extension_proxy.h"
7 #include "chrome/test/automation/tab_proxy.h" 7 #include "chrome/test/automation/tab_proxy.h"
8 #include "chrome/test/ui/ui_test.h" 8 #include "chrome/test/ui/ui_test.h"
9 #include "net/url_request/url_request_unittest.h" 9 #include "net/test/test_server.h"
10 10
11 class InfoBarsUITest : public UITest { 11 class InfoBarsUITest : public UITest {
12 public: 12 public:
13 InfoBarsUITest() { 13 InfoBarsUITest() {
14 show_window_ = true; 14 show_window_ = true;
15 } 15 }
16 }; 16 };
17 17
18 TEST_F(InfoBarsUITest, TestInfoBarsCloseOnNewTheme) { 18 TEST_F(InfoBarsUITest, TestInfoBarsCloseOnNewTheme) {
19 const wchar_t kDocRoot[] = L"chrome/test/data"; 19 const wchar_t kDocRoot[] = L"chrome/test/data";
20 scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); 20 scoped_refptr<net::HTTPTestServer> server(
21 net::HTTPTestServer::CreateServer(kDocRoot));
21 ASSERT_TRUE(server.get() != NULL); 22 ASSERT_TRUE(server.get() != NULL);
22 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); 23 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
23 ASSERT_TRUE(browser.get()); 24 ASSERT_TRUE(browser.get());
24 25
25 scoped_refptr<TabProxy> tab_1(browser->GetActiveTab()); 26 scoped_refptr<TabProxy> tab_1(browser->GetActiveTab());
26 ASSERT_TRUE(tab_1.get()); 27 ASSERT_TRUE(tab_1.get());
27 EXPECT_TRUE(tab_1->NavigateToURL( 28 EXPECT_TRUE(tab_1->NavigateToURL(
28 server->TestServerPage("files/simple.html"))); 29 server->TestServerPage("files/simple.html")));
29 scoped_refptr<ExtensionProxy> theme = automation()->InstallExtension( 30 scoped_refptr<ExtensionProxy> theme = automation()->InstallExtension(
30 test_data_directory_.AppendASCII("extensions").AppendASCII("theme.crx"), 31 test_data_directory_.AppendASCII("extensions").AppendASCII("theme.crx"),
31 true); 32 true);
32 ASSERT_TRUE(theme != NULL); 33 ASSERT_TRUE(theme != NULL);
33 EXPECT_TRUE(tab_1->WaitForInfoBarCount(1, action_max_timeout_ms())); 34 EXPECT_TRUE(tab_1->WaitForInfoBarCount(1, action_max_timeout_ms()));
34 35
35 EXPECT_TRUE(browser->AppendTab( 36 EXPECT_TRUE(browser->AppendTab(
36 server->TestServerPage("files/simple.html"))); 37 server->TestServerPage("files/simple.html")));
37 WaitUntilTabCount(2); 38 WaitUntilTabCount(2);
38 scoped_refptr<TabProxy> tab_2(browser->GetActiveTab()); 39 scoped_refptr<TabProxy> tab_2(browser->GetActiveTab());
39 ASSERT_TRUE(tab_2.get()); 40 ASSERT_TRUE(tab_2.get());
40 theme = automation()->InstallExtension( 41 theme = automation()->InstallExtension(
41 test_data_directory_.AppendASCII("extensions").AppendASCII("theme2.crx"), 42 test_data_directory_.AppendASCII("extensions").AppendASCII("theme2.crx"),
42 true); 43 true);
43 ASSERT_TRUE(theme != NULL); 44 ASSERT_TRUE(theme != NULL);
44 EXPECT_TRUE(tab_2->WaitForInfoBarCount(1, action_max_timeout_ms())); 45 EXPECT_TRUE(tab_2->WaitForInfoBarCount(1, action_max_timeout_ms()));
45 EXPECT_TRUE(tab_1->WaitForInfoBarCount(0, action_max_timeout_ms())); 46 EXPECT_TRUE(tab_1->WaitForInfoBarCount(0, action_max_timeout_ms()));
46 47
47 EXPECT_TRUE(automation()->ResetToDefaultTheme()); 48 EXPECT_TRUE(automation()->ResetToDefaultTheme());
48 EXPECT_TRUE(tab_2->WaitForInfoBarCount(0, action_max_timeout_ms())); 49 EXPECT_TRUE(tab_2->WaitForInfoBarCount(0, action_max_timeout_ms()));
49 } 50 }
OLDNEW
« no previous file with comments | « chrome/test/in_process_browser_test.cc ('k') | chrome/test/live_sync/live_sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698