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

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

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 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) 2012 The Chromium Authors. All rights reserved. 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 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/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/chrome_notification_types.h" 6 #include "chrome/browser/chrome_notification_types.h"
7 #include "chrome/browser/extensions/crx_installer.h" 7 #include "chrome/browser/extensions/crx_installer.h"
8 #include "chrome/browser/extensions/extension_install_prompt.h" 8 #include "chrome/browser/extensions/extension_install_prompt.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 extensions::ScopedTestDialogAutoConfirm auto_confirm( 53 extensions::ScopedTestDialogAutoConfirm auto_confirm(
54 extensions::ScopedTestDialogAutoConfirm::ACCEPT); 54 extensions::ScopedTestDialogAutoConfirm::ACCEPT);
55 55
56 #if defined(OS_WIN) && defined(USE_ASH) 56 #if defined(OS_WIN) && defined(USE_ASH)
57 // Disable this test in Metro+Ash for now (http://crbug.com/262796). 57 // Disable this test in Metro+Ash for now (http://crbug.com/262796).
58 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 58 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
59 switches::kAshBrowserTests)) 59 switches::kAshBrowserTests))
60 return; 60 return;
61 #endif 61 #endif
62 62
63 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 63 ASSERT_TRUE(embedded_test_server()->Start());
64 64
65 ui_test_utils::NavigateToURL( 65 ui_test_utils::NavigateToURL(
66 browser(), embedded_test_server()->GetURL("/simple.html")); 66 browser(), embedded_test_server()->GetURL("/simple.html"));
67 67
68 content::WindowedNotificationObserver infobar_added_1( 68 content::WindowedNotificationObserver infobar_added_1(
69 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, 69 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED,
70 content::NotificationService::AllSources()); 70 content::NotificationService::AllSources());
71 InstallExtension("theme.crx"); 71 InstallExtension("theme.crx");
72 infobar_added_1.Wait(); 72 infobar_added_1.Wait();
73 73
(...skipping 17 matching lines...) Expand all
91 content::WindowedNotificationObserver infobar_removed_2( 91 content::WindowedNotificationObserver infobar_removed_2(
92 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, 92 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
93 content::NotificationService::AllSources()); 93 content::NotificationService::AllSources());
94 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); 94 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme();
95 infobar_removed_2.Wait(); 95 infobar_removed_2.Wait();
96 EXPECT_EQ(0u, 96 EXPECT_EQ(0u,
97 InfoBarService::FromWebContents( 97 InfoBarService::FromWebContents(
98 browser()->tab_strip_model()->GetActiveWebContents())-> 98 browser()->tab_strip_model()->GetActiveWebContents())->
99 infobar_count()); 99 infobar_count());
100 } 100 }
OLDNEW
« no previous file with comments | « chrome/browser/history/redirect_browsertest.cc ('k') | chrome/browser/lifetime/browser_close_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698