| 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/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/metrics/histogram_base.h" | 9 #include "base/metrics/histogram_base.h" |
| 10 #include "base/metrics/histogram_samples.h" | 10 #include "base/metrics/histogram_samples.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // for use with BlockUntilHistoryProcessesPendingRequests. | 88 // for use with BlockUntilHistoryProcessesPendingRequests. |
| 89 class QuittingHistoryDBTask : public history::HistoryDBTask { | 89 class QuittingHistoryDBTask : public history::HistoryDBTask { |
| 90 public: | 90 public: |
| 91 QuittingHistoryDBTask() {} | 91 QuittingHistoryDBTask() {} |
| 92 | 92 |
| 93 bool RunOnDBThread(history::HistoryBackend* backend, | 93 bool RunOnDBThread(history::HistoryBackend* backend, |
| 94 history::HistoryDatabase* db) override { | 94 history::HistoryDatabase* db) override { |
| 95 return true; | 95 return true; |
| 96 } | 96 } |
| 97 | 97 |
| 98 void DoneRunOnMainThread() override { base::MessageLoop::current()->Quit(); } | 98 void DoneRunOnMainThread() override { |
| 99 base::MessageLoop::current()->QuitWhenIdle(); |
| 100 } |
| 99 | 101 |
| 100 private: | 102 private: |
| 101 ~QuittingHistoryDBTask() override {} | 103 ~QuittingHistoryDBTask() override {} |
| 102 | 104 |
| 103 DISALLOW_COPY_AND_ASSIGN(QuittingHistoryDBTask); | 105 DISALLOW_COPY_AND_ASSIGN(QuittingHistoryDBTask); |
| 104 }; | 106 }; |
| 105 | 107 |
| 106 class FakeNetworkChangeNotifier : public net::NetworkChangeNotifier { | 108 class FakeNetworkChangeNotifier : public net::NetworkChangeNotifier { |
| 107 public: | 109 public: |
| 108 FakeNetworkChangeNotifier() : connection_type_(CONNECTION_NONE) {} | 110 FakeNetworkChangeNotifier() : connection_type_(CONNECTION_NONE) {} |
| (...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 stream << "link.href = \"" << result_url.spec() << "\";"; | 1005 stream << "link.href = \"" << result_url.spec() << "\";"; |
| 1004 stream << "document.body.appendChild(link);"; | 1006 stream << "document.body.appendChild(link);"; |
| 1005 stream << "link.click();"; | 1007 stream << "link.click();"; |
| 1006 EXPECT_TRUE(content::ExecuteScript(contents, stream.str())); | 1008 EXPECT_TRUE(content::ExecuteScript(contents, stream.str())); |
| 1007 | 1009 |
| 1008 content::WaitForLoadStop(contents); | 1010 content::WaitForLoadStop(contents); |
| 1009 std::string expected_title = | 1011 std::string expected_title = |
| 1010 "Referrer is " + instant_url().GetWithEmptyPath().spec(); | 1012 "Referrer is " + instant_url().GetWithEmptyPath().spec(); |
| 1011 EXPECT_EQ(ASCIIToUTF16(expected_title), contents->GetTitle()); | 1013 EXPECT_EQ(ASCIIToUTF16(expected_title), contents->GetTitle()); |
| 1012 } | 1014 } |
| OLD | NEW |