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

Side by Side Diff: chrome/browser/infobars/infobars_uitest.cc

Issue 10115018: Convert the infobars interactive_ui_test to a browser_test. Remove the ExtensionProxy class which… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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/browser/infobars/infobars_browsertest.cc ('k') | chrome/chrome_browser.gypi » ('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 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/test/automation/automation_proxy.h"
6 #include "chrome/test/automation/browser_proxy.h"
7 #include "chrome/test/automation/extension_proxy.h"
8 #include "chrome/test/automation/tab_proxy.h"
9 #include "chrome/test/ui/ui_test.h"
10 #include "net/test/test_server.h"
11
12 class InfoBarsUITest : public UITest {
13 public:
14 InfoBarsUITest() {
15 show_window_ = true;
16 }
17 };
18
19 TEST_F(InfoBarsUITest, TestInfoBarsCloseOnNewTheme) {
20 net::TestServer test_server(net::TestServer::TYPE_HTTP,
21 net::TestServer::kLocalhost,
22 FilePath(FILE_PATH_LITERAL("chrome/test/data")));
23 ASSERT_TRUE(test_server.Start());
24
25 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
26 ASSERT_TRUE(browser.get());
27
28 scoped_refptr<TabProxy> tab_1(browser->GetActiveTab());
29 ASSERT_TRUE(tab_1.get());
30 EXPECT_TRUE(tab_1->NavigateToURL(
31 test_server.GetURL("files/simple.html")));
32 scoped_refptr<ExtensionProxy> theme = automation()->InstallExtension(
33 test_data_directory_.AppendASCII("extensions").AppendASCII("theme.crx"),
34 true);
35 ASSERT_TRUE(theme != NULL);
36 EXPECT_TRUE(tab_1->WaitForInfoBarCount(1));
37
38 EXPECT_TRUE(browser->AppendTab(
39 test_server.GetURL("files/simple.html")));
40 WaitUntilTabCount(2);
41 scoped_refptr<TabProxy> tab_2(browser->GetActiveTab());
42 ASSERT_TRUE(tab_2.get());
43 theme = automation()->InstallExtension(
44 test_data_directory_.AppendASCII("extensions").AppendASCII("theme2.crx"),
45 true);
46 ASSERT_TRUE(theme != NULL);
47 EXPECT_TRUE(tab_2->WaitForInfoBarCount(1));
48 EXPECT_TRUE(tab_1->WaitForInfoBarCount(0));
49
50 EXPECT_TRUE(automation()->ResetToDefaultTheme());
51 EXPECT_TRUE(tab_2->WaitForInfoBarCount(0));
52 }
OLDNEW
« no previous file with comments | « chrome/browser/infobars/infobars_browsertest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698