| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/automation_proxy.h" | 5 #include "chrome/test/automation/automation_proxy.h" |
| 6 #include "chrome/test/automation/browser_proxy.h" | 6 #include "chrome/test/automation/browser_proxy.h" |
| 7 #include "chrome/test/automation/extension_proxy.h" | 7 #include "chrome/test/automation/extension_proxy.h" |
| 8 #include "chrome/test/automation/tab_proxy.h" | 8 #include "chrome/test/automation/tab_proxy.h" |
| 9 #include "chrome/test/ui/ui_test.h" | 9 #include "chrome/test/ui/ui_test.h" |
| 10 #include "net/test/test_server.h" | 10 #include "net/test/test_server.h" |
| 11 | 11 |
| 12 class InfoBarsUITest : public UITest { | 12 class InfoBarsUITest : public UITest { |
| 13 public: | 13 public: |
| 14 InfoBarsUITest() { | 14 InfoBarsUITest() { |
| 15 show_window_ = true; | 15 show_window_ = true; |
| 16 } | 16 } |
| 17 }; | 17 }; |
| 18 | 18 |
| 19 TEST_F(InfoBarsUITest, TestInfoBarsCloseOnNewTheme) { | 19 TEST_F(InfoBarsUITest, TestInfoBarsCloseOnNewTheme) { |
| 20 net::TestServer test_server(net::TestServer::TYPE_HTTP, | 20 net::TestServer test_server(net::TestServer::TYPE_HTTP, |
| 21 net::TestServer::kLocalhost, |
| 21 FilePath(FILE_PATH_LITERAL("chrome/test/data"))); | 22 FilePath(FILE_PATH_LITERAL("chrome/test/data"))); |
| 22 ASSERT_TRUE(test_server.Start()); | 23 ASSERT_TRUE(test_server.Start()); |
| 23 | 24 |
| 24 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 25 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
| 25 ASSERT_TRUE(browser.get()); | 26 ASSERT_TRUE(browser.get()); |
| 26 | 27 |
| 27 scoped_refptr<TabProxy> tab_1(browser->GetActiveTab()); | 28 scoped_refptr<TabProxy> tab_1(browser->GetActiveTab()); |
| 28 ASSERT_TRUE(tab_1.get()); | 29 ASSERT_TRUE(tab_1.get()); |
| 29 EXPECT_TRUE(tab_1->NavigateToURL( | 30 EXPECT_TRUE(tab_1->NavigateToURL( |
| 30 test_server.GetURL("files/simple.html"))); | 31 test_server.GetURL("files/simple.html"))); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 42 theme = automation()->InstallExtension( | 43 theme = automation()->InstallExtension( |
| 43 test_data_directory_.AppendASCII("extensions").AppendASCII("theme2.crx"), | 44 test_data_directory_.AppendASCII("extensions").AppendASCII("theme2.crx"), |
| 44 true); | 45 true); |
| 45 ASSERT_TRUE(theme != NULL); | 46 ASSERT_TRUE(theme != NULL); |
| 46 EXPECT_TRUE(tab_2->WaitForInfoBarCount(1)); | 47 EXPECT_TRUE(tab_2->WaitForInfoBarCount(1)); |
| 47 EXPECT_TRUE(tab_1->WaitForInfoBarCount(0)); | 48 EXPECT_TRUE(tab_1->WaitForInfoBarCount(0)); |
| 48 | 49 |
| 49 EXPECT_TRUE(automation()->ResetToDefaultTheme()); | 50 EXPECT_TRUE(automation()->ResetToDefaultTheme()); |
| 50 EXPECT_TRUE(tab_2->WaitForInfoBarCount(0)); | 51 EXPECT_TRUE(tab_2->WaitForInfoBarCount(0)); |
| 51 } | 52 } |
| OLD | NEW |