| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/tab_contents/infobar_delegate.h" | 12 #include "chrome/browser/tab_contents/infobar_delegate.h" |
| 13 #include "chrome/common/net/url_fetcher.h" | 13 #include "chrome/common/net/url_fetcher.h" |
| 14 #include "chrome/common/net/url_request_context_getter.h" | 14 #include "chrome/common/net/url_request_context_getter.h" |
| 15 #include "chrome/common/net/test_url_fetcher_factory.h" | 15 #include "chrome/common/net/test_url_fetcher_factory.h" |
| 16 #include "chrome/common/notification_service.h" | 16 #include "chrome/common/notification_service.h" |
| 17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 18 #include "chrome/test/testing_browser_process.h" | 18 #include "chrome/test/testing_browser_process.h" |
| 19 #include "chrome/test/testing_pref_service.h" | 19 #include "chrome/test/testing_pref_service.h" |
| 20 #include "chrome/test/testing_profile.h" | 20 #include "chrome/test/testing_profile.h" |
| 21 #include "net/url_request/url_request.h" | 21 #include "net/url_request/url_request.h" |
| 22 #include "net/url_request/url_request_unittest.h" | 22 #include "net/url_request/url_request_test_util.h" |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 24 | 24 |
| 25 // TestNotificationObserver --------------------------------------------------- | 25 // TestNotificationObserver --------------------------------------------------- |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 class TestNotificationObserver : public NotificationObserver { | 29 class TestNotificationObserver : public NotificationObserver { |
| 30 public: | 30 public: |
| 31 TestNotificationObserver(); | 31 TestNotificationObserver(); |
| 32 virtual ~TestNotificationObserver(); | 32 virtual ~TestNotificationObserver(); |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 NavEntryCommitted(); | 482 NavEntryCommitted(); |
| 483 EXPECT_TRUE(InfoBarIsShown()); | 483 EXPECT_TRUE(InfoBarIsShown()); |
| 484 | 484 |
| 485 AcceptGoogleURL(); | 485 AcceptGoogleURL(); |
| 486 InfoBarClosed(); | 486 InfoBarClosed(); |
| 487 EXPECT_FALSE(InfoBarIsShown()); | 487 EXPECT_FALSE(InfoBarIsShown()); |
| 488 EXPECT_EQ(GURL("http://www.google.co.jp/"), GoogleURLTracker::GoogleURL()); | 488 EXPECT_EQ(GURL("http://www.google.co.jp/"), GoogleURLTracker::GoogleURL()); |
| 489 EXPECT_EQ(GURL("http://www.google.co.jp/"), GetLastPromptedGoogleURL()); | 489 EXPECT_EQ(GURL("http://www.google.co.jp/"), GetLastPromptedGoogleURL()); |
| 490 EXPECT_TRUE(observer_->notified()); | 490 EXPECT_TRUE(observer_->notified()); |
| 491 } | 491 } |
| OLD | NEW |