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

Unified Diff: chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc

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: Fixed InstantNTPPrerendererTest Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/search/instant_ntp_prerenderer.cc ('k') | chrome/browser/ui/search/instant_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc
diff --git a/chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc b/chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc
index 917e01a0ea08f7c674753c610cb8c1aa62644765..c3899b7faf35f9ae37a2538dd01d3a7f7d34a25e 100644
--- a/chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc
+++ b/chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc
@@ -3,11 +3,9 @@
// found in the LICENSE file.
#include "base/memory/scoped_ptr.h"
-#include "base/metrics/histogram.h"
-#include "base/metrics/histogram_samples.h"
-#include "base/metrics/statistics_recorder.h"
#include "base/prefs/pref_service.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
+#include "chrome/browser/search/instant_service_factory.h"
#include "chrome/browser/search/search.h"
#include "chrome/browser/ui/search/instant_ntp.h"
#include "chrome/browser/ui/search/instant_ntp_prerenderer.h"
@@ -17,10 +15,6 @@
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
-using base::HistogramBase;
-using base::HistogramSamples;
-using base::StatisticsRecorder;
-
class TestableInstantNTP : public InstantNTP {
public:
TestableInstantNTP(InstantNTPPrerenderer* ntp_prerenderer,
@@ -62,13 +56,15 @@ class TestableInstantNTP : public InstantNTP {
class TestableInstantNTPPrerenderer : public InstantNTPPrerenderer {
public:
- explicit TestableInstantNTPPrerenderer(TestingProfile* profile)
- : InstantNTPPrerenderer(profile, NULL),
+ explicit TestableInstantNTPPrerenderer(TestingProfile* profile,
+ InstantService* instant_service)
+ : InstantNTPPrerenderer(profile, instant_service, NULL),
test_instant_url_("http://test_url"),
override_javascript_enabled_(true),
test_javascript_enabled_(true),
test_in_startup_(false),
- test_ntp_(NULL) {}
+ test_ntp_(NULL) {
+ }
// Overrides from InstantNTPPrerenderer
virtual std::string GetInstantURL() const OVERRIDE {
@@ -125,10 +121,15 @@ private:
class InstantNTPPrerendererTest : public testing::Test {
public:
- InstantNTPPrerendererTest()
- : instant_ntp_prerenderer_(new TestableInstantNTPPrerenderer(&profile_)) {
- base::StatisticsRecorder::Initialize();
+ virtual void SetUp() OVERRIDE {
chrome::EnableInstantExtendedAPIForTesting();
+ instant_service_ = InstantServiceFactory::GetForProfile(&profile_);
+ instant_ntp_prerenderer_.reset(
+ new TestableInstantNTPPrerenderer(&profile_, instant_service_));
+ }
+
+ virtual void TearDown() OVERRIDE {
+ instant_ntp_prerenderer_.reset();
}
TestableInstantNTPPrerenderer* instant_ntp_prerenderer() {
@@ -142,6 +143,7 @@ class InstantNTPPrerendererTest : public testing::Test {
private:
content::TestBrowserThreadBundle thread_bundle_;
scoped_ptr<TestableInstantNTPPrerenderer> instant_ntp_prerenderer_;
+ InstantService* instant_service_;
mutable TestingProfile profile_;
};
« no previous file with comments | « chrome/browser/ui/search/instant_ntp_prerenderer.cc ('k') | chrome/browser/ui/search/instant_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698