| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 DISALLOW_COPY_AND_ASSIGN(QuittingHistoryDBTask); | 102 DISALLOW_COPY_AND_ASSIGN(QuittingHistoryDBTask); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 class FakeNetworkChangeNotifier : public net::NetworkChangeNotifier { | 105 class FakeNetworkChangeNotifier : public net::NetworkChangeNotifier { |
| 106 public: | 106 public: |
| 107 FakeNetworkChangeNotifier() : connection_type_(CONNECTION_NONE) {} | 107 FakeNetworkChangeNotifier() : connection_type_(CONNECTION_NONE) {} |
| 108 | 108 |
| 109 ConnectionType GetCurrentConnectionType() const override { | 109 ConnectionType GetCurrentConnectionType() const override { |
| 110 return connection_type_; | 110 return connection_type_; |
| 111 } | 111 } |
| 112 std::string GetCurrentWiFiSSID() const override { |
| 113 return ""; |
| 114 } |
| 112 | 115 |
| 113 void SetConnectionType(ConnectionType type) { | 116 void SetConnectionType(ConnectionType type) { |
| 114 connection_type_ = type; | 117 connection_type_ = type; |
| 115 NotifyObserversOfNetworkChange(type); | 118 NotifyObserversOfNetworkChange(type); |
| 116 base::RunLoop().RunUntilIdle(); | 119 base::RunLoop().RunUntilIdle(); |
| 117 } | 120 } |
| 118 | 121 |
| 119 ~FakeNetworkChangeNotifier() override {} | 122 ~FakeNetworkChangeNotifier() override {} |
| 120 | 123 |
| 121 private: | 124 private: |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 stream << "link.href = \"" << result_url.spec() << "\";"; | 971 stream << "link.href = \"" << result_url.spec() << "\";"; |
| 969 stream << "document.body.appendChild(link);"; | 972 stream << "document.body.appendChild(link);"; |
| 970 stream << "link.click();"; | 973 stream << "link.click();"; |
| 971 EXPECT_TRUE(content::ExecuteScript(contents, stream.str())); | 974 EXPECT_TRUE(content::ExecuteScript(contents, stream.str())); |
| 972 | 975 |
| 973 content::WaitForLoadStop(contents); | 976 content::WaitForLoadStop(contents); |
| 974 std::string expected_title = | 977 std::string expected_title = |
| 975 "Referrer is " + instant_url().GetWithEmptyPath().spec(); | 978 "Referrer is " + instant_url().GetWithEmptyPath().spec(); |
| 976 EXPECT_EQ(ASCIIToUTF16(expected_title), contents->GetTitle()); | 979 EXPECT_EQ(ASCIIToUTF16(expected_title), contents->GetTitle()); |
| 977 } | 980 } |
| OLD | NEW |