OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/google/google_url_tracker.h" | 5 #include "chrome/browser/google/google_url_tracker.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 } | 243 } |
244 | 244 |
245 void GoogleURLTrackerTest::FinishSleep() { | 245 void GoogleURLTrackerTest::FinishSleep() { |
246 google_url_tracker_->FinishSleep(); | 246 google_url_tracker_->FinishSleep(); |
247 } | 247 } |
248 | 248 |
249 void GoogleURLTrackerTest::NotifyIPAddressChanged() { | 249 void GoogleURLTrackerTest::NotifyIPAddressChanged() { |
250 net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); | 250 net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); |
251 // For thread safety, the NCN queues tasks to do the actual notifications, so | 251 // For thread safety, the NCN queues tasks to do the actual notifications, so |
252 // we need to spin the message loop so the tracker will actually be notified. | 252 // we need to spin the message loop so the tracker will actually be notified. |
253 MessageLoop::current()->RunAllPending(); | 253 MessageLoop::current()->RunUntilIdle(); |
254 } | 254 } |
255 | 255 |
256 void GoogleURLTrackerTest::SetLastPromptedGoogleURL(const GURL& url) { | 256 void GoogleURLTrackerTest::SetLastPromptedGoogleURL(const GURL& url) { |
257 profile_.GetPrefs()->SetString(prefs::kLastPromptedGoogleURL, url.spec()); | 257 profile_.GetPrefs()->SetString(prefs::kLastPromptedGoogleURL, url.spec()); |
258 } | 258 } |
259 | 259 |
260 GURL GoogleURLTrackerTest::GetLastPromptedGoogleURL() { | 260 GURL GoogleURLTrackerTest::GetLastPromptedGoogleURL() { |
261 return GURL(profile_.GetPrefs()->GetString(prefs::kLastPromptedGoogleURL)); | 261 return GURL(profile_.GetPrefs()->GetString(prefs::kLastPromptedGoogleURL)); |
262 } | 262 } |
263 | 263 |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 CommitSearch(2, GURL("http://www.google.co.uk/search?q=test2")); | 1029 CommitSearch(2, GURL("http://www.google.co.uk/search?q=test2")); |
1030 EXPECT_FALSE(GetInfoBar(1) == NULL); | 1030 EXPECT_FALSE(GetInfoBar(1) == NULL); |
1031 GoogleURLTrackerInfoBarDelegate* infobar2 = GetInfoBar(2); | 1031 GoogleURLTrackerInfoBarDelegate* infobar2 = GetInfoBar(2); |
1032 ASSERT_FALSE(infobar2 == NULL); | 1032 ASSERT_FALSE(infobar2 == NULL); |
1033 SetNavigationPending(1, true); | 1033 SetNavigationPending(1, true); |
1034 ASSERT_NO_FATAL_FAILURE(ExpectListeningForCommit(1, true)); | 1034 ASSERT_NO_FATAL_FAILURE(ExpectListeningForCommit(1, true)); |
1035 infobar2->Close(false); | 1035 infobar2->Close(false); |
1036 SetNavigationPending(1, false); | 1036 SetNavigationPending(1, false); |
1037 ASSERT_NO_FATAL_FAILURE(ExpectListeningForCommit(1, false)); | 1037 ASSERT_NO_FATAL_FAILURE(ExpectListeningForCommit(1, false)); |
1038 } | 1038 } |
OLD | NEW |