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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 BrowserWithTestWindowTest::TearDown(); | 56 BrowserWithTestWindowTest::TearDown(); |
57 } | 57 } |
58 | 58 |
59 protected: | 59 protected: |
60 scoped_ptr<TestWebContentsDelegate> test_web_contents_delegate_; | 60 scoped_ptr<TestWebContentsDelegate> test_web_contents_delegate_; |
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 scoped_refptr<history::HistoryAddPageArgs> should_add_args( | 66 history::HistoryAddPageArgs should_add_args( |
67 new history::HistoryAddPageArgs( | |
68 GURL(), base::Time::Now(), 0, 0, GURL(), history::RedirectList(), | 67 GURL(), base::Time::Now(), 0, 0, GURL(), history::RedirectList(), |
69 content::PAGE_TRANSITION_TYPED, history::SOURCE_SYNCED, false)); | 68 content::PAGE_TRANSITION_TYPED, history::SOURCE_SYNCED, false); |
70 EXPECT_FALSE(test_web_contents_delegate_->ShouldAddNavigationToHistory( | 69 EXPECT_FALSE(test_web_contents_delegate_->ShouldAddNavigationToHistory( |
71 *should_add_args, content::NAVIGATION_TYPE_NEW_PAGE)); | 70 should_add_args, content::NAVIGATION_TYPE_NEW_PAGE)); |
72 test_web_contents_delegate_->NavigationStateChanged(NULL, 0); | 71 test_web_contents_delegate_->NavigationStateChanged(NULL, 0); |
73 test_web_contents_delegate_->ActivateContents(NULL); | 72 test_web_contents_delegate_->ActivateContents(NULL); |
74 test_web_contents_delegate_->LoadingStateChanged(NULL); | 73 test_web_contents_delegate_->LoadingStateChanged(NULL); |
75 test_web_contents_delegate_->CloseContents(NULL); | 74 test_web_contents_delegate_->CloseContents(NULL); |
76 test_web_contents_delegate_->UpdateTargetURL(NULL, 0, GURL()); | 75 test_web_contents_delegate_->UpdateTargetURL(NULL, 0, GURL()); |
77 test_web_contents_delegate_->MoveContents(NULL, gfx::Rect()); | 76 test_web_contents_delegate_->MoveContents(NULL, gfx::Rect()); |
78 EXPECT_EQ(0, browser()->tab_count()); | 77 EXPECT_EQ(0, browser()->tab_count()); |
79 EXPECT_EQ(1U, BrowserList::size()); | 78 EXPECT_EQ(1U, BrowserList::size()); |
80 } | 79 } |
81 | 80 |
(...skipping 24 matching lines...) Expand all Loading... |
106 test_web_contents_delegate_->OpenURLFromTab( | 105 test_web_contents_delegate_->OpenURLFromTab( |
107 NULL, OpenURLParams(GURL(chrome::kAboutBlankURL), Referrer(), | 106 NULL, OpenURLParams(GURL(chrome::kAboutBlankURL), Referrer(), |
108 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false)); | 107 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false)); |
109 test_web_contents_delegate_->AddNewContents(NULL, NULL, NEW_FOREGROUND_TAB, | 108 test_web_contents_delegate_->AddNewContents(NULL, NULL, NEW_FOREGROUND_TAB, |
110 gfx::Rect(), false, NULL); | 109 gfx::Rect(), false, NULL); |
111 EXPECT_EQ(0, browser()->tab_count()); | 110 EXPECT_EQ(0, browser()->tab_count()); |
112 EXPECT_EQ(1U, BrowserList::size()); | 111 EXPECT_EQ(1U, BrowserList::size()); |
113 } | 112 } |
114 | 113 |
115 } // namespace | 114 } // namespace |
OLD | NEW |