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

Side by Side Diff: chrome/browser/ui/browser_instant_controller_unittest.cc

Issue 24733003: Update defaults for InstantExtended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up test. Created 7 years, 2 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
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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/search/instant_service.h" 10 #include "chrome/browser/search/instant_service.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 GoogleBaseURLUpdated); 90 GoogleBaseURLUpdated);
91 91
92 private: 92 private:
93 content::WebContents* contents_; 93 content::WebContents* contents_;
94 BrowserInstantControllerTest* base_test_; 94 BrowserInstantControllerTest* base_test_;
95 const GURL& url_; 95 const GURL& url_;
96 int num_reloads_; 96 int num_reloads_;
97 }; 97 };
98 98
99 TEST_F(BrowserInstantControllerTest, DefaultSearchProviderChanged) { 99 TEST_F(BrowserInstantControllerTest, DefaultSearchProviderChanged) {
100 chrome::EnableQueryExtractionForTesting();
100 size_t num_tests = arraysize(kTabReloadTestCases); 101 size_t num_tests = arraysize(kTabReloadTestCases);
101 ScopedVector<FakeWebContentsObserver> observers; 102 ScopedVector<FakeWebContentsObserver> observers;
102 for (size_t i = 0; i < num_tests; ++i) { 103 for (size_t i = 0; i < num_tests; ++i) {
103 const TabReloadTestCase& test = kTabReloadTestCases[i]; 104 const TabReloadTestCase& test = kTabReloadTestCases[i];
104 AddTab(browser(), GURL(test.start_url)); 105 AddTab(browser(), GURL(test.start_url));
105 content::WebContents* contents = 106 content::WebContents* contents =
106 browser()->tab_strip_model()->GetActiveWebContents(); 107 browser()->tab_strip_model()->GetActiveWebContents();
107 108
108 // Validate initial instant state. 109 // Validate initial instant state.
109 EXPECT_EQ(test.start_in_instant_process, 110 EXPECT_EQ(test.start_in_instant_process,
(...skipping 18 matching lines...) Expand all
128 contents->GetRenderProcessHost()->GetID())) 129 contents->GetRenderProcessHost()->GetID()))
129 << test.description; 130 << test.description;
130 131
131 // Ensure only the expected tabs(contents) reloaded. 132 // Ensure only the expected tabs(contents) reloaded.
132 EXPECT_EQ(test.should_reload ? 1 : 0, observer->num_reloads()) 133 EXPECT_EQ(test.should_reload ? 1 : 0, observer->num_reloads())
133 << test.description; 134 << test.description;
134 } 135 }
135 } 136 }
136 137
137 TEST_F(BrowserInstantControllerTest, GoogleBaseURLUpdated) { 138 TEST_F(BrowserInstantControllerTest, GoogleBaseURLUpdated) {
139 chrome::EnableQueryExtractionForTesting();
138 const size_t num_tests = arraysize(kTabReloadTestCases); 140 const size_t num_tests = arraysize(kTabReloadTestCases);
139 ScopedVector<FakeWebContentsObserver> observers; 141 ScopedVector<FakeWebContentsObserver> observers;
140 for (size_t i = 0; i < num_tests; ++i) { 142 for (size_t i = 0; i < num_tests; ++i) {
141 const TabReloadTestCase& test = kTabReloadTestCases[i]; 143 const TabReloadTestCase& test = kTabReloadTestCases[i];
142 AddTab(browser(), GURL(test.start_url)); 144 AddTab(browser(), GURL(test.start_url));
143 content::WebContents* contents = 145 content::WebContents* contents =
144 browser()->tab_strip_model()->GetActiveWebContents(); 146 browser()->tab_strip_model()->GetActiveWebContents();
145 147
146 // Validate initial instant state. 148 // Validate initial instant state.
147 EXPECT_EQ(test.start_in_instant_process, 149 EXPECT_EQ(test.start_in_instant_process,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 186
185 browser.reset(NULL); 187 browser.reset(NULL);
186 window.reset(NULL); 188 window.reset(NULL);
187 EXPECT_FALSE(IsInstantServiceObserver(bic)) 189 EXPECT_FALSE(IsInstantServiceObserver(bic))
188 << "New BrowserInstantController should register as InstantServiceObserver"; 190 << "New BrowserInstantController should register as InstantServiceObserver";
189 } 191 }
190 192
191 } // namespace 193 } // namespace
192 194
193 } // namespace chrome 195 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698