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 "ui/web_dialogs/web_dialog_web_contents_delegate.h" | 5 #include "ui/web_dialogs/web_dialog_web_contents_delegate.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 }; | 61 }; |
62 | 62 |
63 TEST_F(WebDialogWebContentsDelegateTest, DoNothingMethodsTest) { | 63 TEST_F(WebDialogWebContentsDelegateTest, DoNothingMethodsTest) { |
64 // None of the following calls should do anything. | 64 // None of the following calls should do anything. |
65 EXPECT_TRUE(test_web_contents_delegate_->IsPopupOrPanel(NULL)); | 65 EXPECT_TRUE(test_web_contents_delegate_->IsPopupOrPanel(NULL)); |
66 history::HistoryAddPageArgs should_add_args( | 66 history::HistoryAddPageArgs should_add_args( |
67 GURL(), base::Time::Now(), 0, 0, GURL(), history::RedirectList(), | 67 GURL(), base::Time::Now(), 0, 0, GURL(), history::RedirectList(), |
68 ui::PAGE_TRANSITION_TYPED, history::SOURCE_SYNCED, false); | 68 ui::PAGE_TRANSITION_TYPED, history::SOURCE_SYNCED, false); |
69 test_web_contents_delegate_->NavigationStateChanged( | 69 test_web_contents_delegate_->NavigationStateChanged( |
70 NULL, content::InvalidateTypes(0)); | 70 NULL, content::InvalidateTypes(0)); |
71 test_web_contents_delegate_->ActivateContents(NULL); | 71 test_web_contents_delegate_->ActivateContents(NULL, false); |
72 test_web_contents_delegate_->LoadingStateChanged(NULL, true); | 72 test_web_contents_delegate_->LoadingStateChanged(NULL, true); |
73 test_web_contents_delegate_->CloseContents(NULL); | 73 test_web_contents_delegate_->CloseContents(NULL); |
74 test_web_contents_delegate_->UpdateTargetURL(NULL, GURL()); | 74 test_web_contents_delegate_->UpdateTargetURL(NULL, GURL()); |
75 test_web_contents_delegate_->MoveContents(NULL, gfx::Rect()); | 75 test_web_contents_delegate_->MoveContents(NULL, gfx::Rect()); |
76 EXPECT_EQ(0, browser()->tab_strip_model()->count()); | 76 EXPECT_EQ(0, browser()->tab_strip_model()->count()); |
77 EXPECT_EQ(1U, chrome::GetTotalBrowserCount()); | 77 EXPECT_EQ(1U, chrome::GetTotalBrowserCount()); |
78 } | 78 } |
79 | 79 |
80 TEST_F(WebDialogWebContentsDelegateTest, OpenURLFromTabTest) { | 80 TEST_F(WebDialogWebContentsDelegateTest, OpenURLFromTabTest) { |
81 test_web_contents_delegate_->OpenURLFromTab( | 81 test_web_contents_delegate_->OpenURLFromTab( |
(...skipping 30 matching lines...) Expand all Loading... |
112 NEW_FOREGROUND_TAB, | 112 NEW_FOREGROUND_TAB, |
113 ui::PAGE_TRANSITION_LINK, | 113 ui::PAGE_TRANSITION_LINK, |
114 false)); | 114 false)); |
115 test_web_contents_delegate_->AddNewContents(NULL, NULL, NEW_FOREGROUND_TAB, | 115 test_web_contents_delegate_->AddNewContents(NULL, NULL, NEW_FOREGROUND_TAB, |
116 gfx::Rect(), false, NULL); | 116 gfx::Rect(), false, NULL); |
117 EXPECT_EQ(0, browser()->tab_strip_model()->count()); | 117 EXPECT_EQ(0, browser()->tab_strip_model()->count()); |
118 EXPECT_EQ(1U, chrome::GetTotalBrowserCount()); | 118 EXPECT_EQ(1U, chrome::GetTotalBrowserCount()); |
119 } | 119 } |
120 | 120 |
121 } // namespace | 121 } // namespace |
OLD | NEW |