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

Side by Side Diff: chrome/browser/ui/search/local_ntp_browsertest.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "chrome/browser/browser_process.h" 6 #include "chrome/browser/browser_process.h"
7 #include "chrome/browser/search/search.h" 7 #include "chrome/browser/search/search.h"
8 #include "chrome/browser/ui/search/instant_test_utils.h" 8 #include "chrome/browser/ui/search/instant_test_utils.h"
9 #include "chrome/browser/ui/tabs/tab_strip_model.h" 9 #include "chrome/browser/ui/tabs/tab_strip_model.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 19 matching lines...) Expand all
30 https_test_server().GetURL("/local_ntp_browsertest.html?strk=1&"); 30 https_test_server().GetURL("/local_ntp_browsertest.html?strk=1&");
31 InstantTestBase::Init(instant_url, ntp_url, false); 31 InstantTestBase::Init(instant_url, ntp_url, false);
32 } 32 }
33 }; 33 };
34 34
35 IN_PROC_BROWSER_TEST_F(LocalNTPTest, LocalNTPJavascriptTest) { 35 IN_PROC_BROWSER_TEST_F(LocalNTPTest, LocalNTPJavascriptTest) {
36 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); 36 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
37 FocusOmnibox(); 37 FocusOmnibox();
38 38
39 ui_test_utils::NavigateToURLWithDisposition( 39 ui_test_utils::NavigateToURLWithDisposition(
40 browser(), 40 browser(), ntp_url(), WindowOpenDisposition::NEW_FOREGROUND_TAB,
41 ntp_url(),
42 NEW_FOREGROUND_TAB,
43 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB | 41 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB |
44 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); 42 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
45 content::WebContents* active_tab = 43 content::WebContents* active_tab =
46 browser()->tab_strip_model()->GetActiveWebContents(); 44 browser()->tab_strip_model()->GetActiveWebContents();
47 ASSERT_TRUE(search::IsInstantNTP(active_tab)); 45 ASSERT_TRUE(search::IsInstantNTP(active_tab));
48 bool success = false; 46 bool success = false;
49 ASSERT_TRUE(GetBoolFromJS(active_tab, "!!runTests()", &success)); 47 ASSERT_TRUE(GetBoolFromJS(active_tab, "!!runTests()", &success));
50 EXPECT_TRUE(success); 48 EXPECT_TRUE(success);
51 } 49 }
52 50
53 IN_PROC_BROWSER_TEST_F(LocalNTPTest, 51 IN_PROC_BROWSER_TEST_F(LocalNTPTest,
54 NTPRespectsBrowserLanguageSetting) { 52 NTPRespectsBrowserLanguageSetting) {
(...skipping 14 matching lines...) Expand all
69 g_browser_process->SetApplicationLocale(loaded_locale); 67 g_browser_process->SetApplicationLocale(loaded_locale);
70 PrefService* prefs = g_browser_process->local_state(); 68 PrefService* prefs = g_browser_process->local_state();
71 prefs->SetString(prefs::kApplicationLocale, loaded_locale); 69 prefs->SetString(prefs::kApplicationLocale, loaded_locale);
72 70
73 // Setup Instant. 71 // Setup Instant.
74 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); 72 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
75 FocusOmnibox(); 73 FocusOmnibox();
76 74
77 // Open a new tab. 75 // Open a new tab.
78 ui_test_utils::NavigateToURLWithDisposition( 76 ui_test_utils::NavigateToURLWithDisposition(
79 browser(), 77 browser(), GURL(chrome::kChromeUINewTabURL),
80 GURL(chrome::kChromeUINewTabURL), 78 WindowOpenDisposition::NEW_FOREGROUND_TAB,
81 NEW_FOREGROUND_TAB,
82 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB | 79 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB |
83 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); 80 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
84 81
85 // Verify that the NTP is in French. 82 // Verify that the NTP is in French.
86 content::WebContents* active_tab = 83 content::WebContents* active_tab =
87 browser()->tab_strip_model()->GetActiveWebContents(); 84 browser()->tab_strip_model()->GetActiveWebContents();
88 EXPECT_EQ(base::ASCIIToUTF16("Nouvel onglet"), active_tab->GetTitle()); 85 EXPECT_EQ(base::ASCIIToUTF16("Nouvel onglet"), active_tab->GetTitle());
89 } 86 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/instant_search_prerenderer_unittest.cc ('k') | chrome/browser/ui/settings_window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698