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/prefs/browser_prefs.h" | 10 #include "chrome/browser/prefs/browser_prefs.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 TestInfoBarDelegate(GoogleURLTracker* google_url_tracker, | 60 TestInfoBarDelegate(GoogleURLTracker* google_url_tracker, |
61 const GURL& new_google_url); | 61 const GURL& new_google_url); |
62 | 62 |
63 GoogleURLTracker* google_url_tracker() const { return google_url_tracker_; } | 63 GoogleURLTracker* google_url_tracker() const { return google_url_tracker_; } |
64 GURL new_google_url() const { return new_google_url_; } | 64 GURL new_google_url() const { return new_google_url_; } |
65 | 65 |
66 private: | 66 private: |
67 virtual ~TestInfoBarDelegate(); | 67 virtual ~TestInfoBarDelegate(); |
68 | 68 |
69 // InfoBarDelegate: | 69 // InfoBarDelegate: |
70 virtual InfoBar* CreateInfoBar(); | 70 virtual InfoBar* CreateInfoBar(TabContentsWrapper* owner); |
71 | 71 |
72 GoogleURLTracker* google_url_tracker_; | 72 GoogleURLTracker* google_url_tracker_; |
73 GURL new_google_url_; | 73 GURL new_google_url_; |
74 }; | 74 }; |
75 | 75 |
76 TestInfoBarDelegate::TestInfoBarDelegate(GoogleURLTracker* google_url_tracker, | 76 TestInfoBarDelegate::TestInfoBarDelegate(GoogleURLTracker* google_url_tracker, |
77 const GURL& new_google_url) | 77 const GURL& new_google_url) |
78 : InfoBarDelegate(NULL), | 78 : InfoBarDelegate(NULL), |
79 google_url_tracker_(google_url_tracker), | 79 google_url_tracker_(google_url_tracker), |
80 new_google_url_(new_google_url) { | 80 new_google_url_(new_google_url) { |
81 } | 81 } |
82 | 82 |
83 TestInfoBarDelegate::~TestInfoBarDelegate() { | 83 TestInfoBarDelegate::~TestInfoBarDelegate() { |
84 } | 84 } |
85 | 85 |
86 InfoBar* TestInfoBarDelegate::CreateInfoBar() { | 86 InfoBar* TestInfoBarDelegate::CreateInfoBar(TabContentsWrapper* owner) { |
87 return NULL; | 87 return NULL; |
88 } | 88 } |
89 | 89 |
90 InfoBarDelegate* CreateTestInfobar( | 90 InfoBarDelegate* CreateTestInfobar( |
91 TabContents* tab_contents, | 91 TabContents* tab_contents, |
92 GoogleURLTracker* google_url_tracker, | 92 GoogleURLTracker* google_url_tracker, |
93 const GURL& new_google_url) { | 93 const GURL& new_google_url) { |
94 return new TestInfoBarDelegate(google_url_tracker, new_google_url); | 94 return new TestInfoBarDelegate(google_url_tracker, new_google_url); |
95 } | 95 } |
96 | 96 |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 NavEntryCommitted(); | 442 NavEntryCommitted(); |
443 EXPECT_TRUE(InfoBarIsShown()); | 443 EXPECT_TRUE(InfoBarIsShown()); |
444 | 444 |
445 AcceptGoogleURL(); | 445 AcceptGoogleURL(); |
446 InfoBarClosed(); | 446 InfoBarClosed(); |
447 EXPECT_FALSE(InfoBarIsShown()); | 447 EXPECT_FALSE(InfoBarIsShown()); |
448 EXPECT_EQ(GURL("http://www.google.co.jp/"), GoogleURLTracker::GoogleURL()); | 448 EXPECT_EQ(GURL("http://www.google.co.jp/"), GoogleURLTracker::GoogleURL()); |
449 EXPECT_EQ(GURL("http://www.google.co.jp/"), GetLastPromptedGoogleURL()); | 449 EXPECT_EQ(GURL("http://www.google.co.jp/"), GetLastPromptedGoogleURL()); |
450 EXPECT_TRUE(observer_->notified()); | 450 EXPECT_TRUE(observer_->notified()); |
451 } | 451 } |
OLD | NEW |