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

Side by Side Diff: chrome/browser/search/instant_unittest_base.h

Issue 20388003: Reload Instant NTP and Instant-process tabs on search url change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments, added a test to address the bug Created 7 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SEARCH_INSTANT_UNITTEST_BASE_H_
6 #define CHROME_BROWSER_SEARCH_INSTANT_UNITTEST_BASE_H_
7
8 #include <string>
9
10 #include "chrome/browser/search/instant_service.h"
11 #include "chrome/browser/search_engines/template_url_service.h"
12 #include "chrome/test/base/browser_with_test_window_test.h"
13
14 // This class provides an extension on top of BrowserWithTestWindowTest, and
15 // adds some utility methods which can be useful for various unit tests for
16 // Embedded Search / Instant implementation classes.
17 class InstantUnitTestBase : public BrowserWithTestWindowTest {
18 protected:
19 virtual void SetUp() OVERRIDE;
20 virtual void TearDown() OVERRIDE;
21
22 // Adds and sets the default search provider using the base_url.
23 // The base_url should have the http[s]:// prefix and a trailing / after the
24 // TLD.
25 // It will always use an instant-enabled configuration using a
26 // search_terms_replacement_key.
27 void SetSearchProvider(const std::string& base_url);
Jered 2013/08/16 00:13:23 Call this SetDefaultSearchProvider
Anuj 2013/08/22 00:40:45 Done.
28
29 // Simulates a Google Base URL change as would happen in event of
30 // search-domain-check. Note that the GoogleURLTrackerFactory is disabled for
31 // tests, so this is required.
32 void NotifyGoogleBaseURLUpdate(const std::string& new_google_base_url);
33
34 int NumObservers(InstantService* instant_service) {
Jered 2013/08/16 00:13:23 GetNumObservers
Anuj 2013/08/22 00:40:45 Done.
35 return instant_service->observers_.size();
36 }
37
38 InstantService* instant_service_;
39 TemplateURLService* template_url_service_;
40 };
41
42 #endif // CHROME_BROWSER_SEARCH_INSTANT_UNITTEST_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698