| OLD | NEW |
| 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 <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram_base.h" | 8 #include "base/metrics/histogram_base.h" |
| 9 #include "base/metrics/histogram_samples.h" | 9 #include "base/metrics/histogram_samples.h" |
| 10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 void SetUpInProcessBrowserTestFixture() override { | 259 void SetUpInProcessBrowserTestFixture() override { |
| 260 chrome::EnableQueryExtractionForTesting(); | 260 chrome::EnableQueryExtractionForTesting(); |
| 261 ASSERT_TRUE(https_test_server().Start()); | 261 ASSERT_TRUE(https_test_server().Start()); |
| 262 GURL instant_url = https_test_server().GetURL( | 262 GURL instant_url = https_test_server().GetURL( |
| 263 "files/instant_extended.html?strk=1&"); | 263 "files/instant_extended.html?strk=1&"); |
| 264 GURL ntp_url = https_test_server().GetURL( | 264 GURL ntp_url = https_test_server().GetURL( |
| 265 "files/instant_extended_ntp.html?strk=1&"); | 265 "files/instant_extended_ntp.html?strk=1&"); |
| 266 InstantTestBase::Init(instant_url, ntp_url, true); | 266 InstantTestBase::Init(instant_url, ntp_url, true); |
| 267 } | 267 } |
| 268 | 268 |
| 269 void SetUpCommandLine(CommandLine* command_line) override { | 269 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 270 command_line->AppendSwitchASCII( | 270 command_line->AppendSwitchASCII( |
| 271 switches::kForceFieldTrials, | 271 switches::kForceFieldTrials, |
| 272 "EmbeddedSearch/Group11 prefetch_results_srp:1/"); | 272 "EmbeddedSearch/Group11 prefetch_results_srp:1/"); |
| 273 } | 273 } |
| 274 | 274 |
| 275 net::FakeURLFetcherFactory* fake_factory() { return fake_factory_.get(); } | 275 net::FakeURLFetcherFactory* fake_factory() { return fake_factory_.get(); } |
| 276 | 276 |
| 277 private: | 277 private: |
| 278 // Used to instantiate FakeURLFetcherFactory. | 278 // Used to instantiate FakeURLFetcherFactory. |
| 279 scoped_ptr<net::URLFetcherImplFactory> factory_; | 279 scoped_ptr<net::URLFetcherImplFactory> factory_; |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 stream << "link.href = \"" << result_url.spec() << "\";"; | 969 stream << "link.href = \"" << result_url.spec() << "\";"; |
| 970 stream << "document.body.appendChild(link);"; | 970 stream << "document.body.appendChild(link);"; |
| 971 stream << "link.click();"; | 971 stream << "link.click();"; |
| 972 EXPECT_TRUE(content::ExecuteScript(contents, stream.str())); | 972 EXPECT_TRUE(content::ExecuteScript(contents, stream.str())); |
| 973 | 973 |
| 974 content::WaitForLoadStop(contents); | 974 content::WaitForLoadStop(contents); |
| 975 std::string expected_title = | 975 std::string expected_title = |
| 976 "Referrer is " + instant_url().GetWithEmptyPath().spec(); | 976 "Referrer is " + instant_url().GetWithEmptyPath().spec(); |
| 977 EXPECT_EQ(ASCIIToUTF16(expected_title), contents->GetTitle()); | 977 EXPECT_EQ(ASCIIToUTF16(expected_title), contents->GetTitle()); |
| 978 } | 978 } |
| OLD | NEW |