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/ui/webui/html_dialog_tab_contents_delegate.h" | 5 #include "chrome/browser/ui/webui/html_dialog_tab_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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 scoped_refptr<history::HistoryAddPageArgs> should_add_args( | 57 scoped_refptr<history::HistoryAddPageArgs> should_add_args( |
58 new history::HistoryAddPageArgs( | 58 new history::HistoryAddPageArgs( |
59 GURL(), base::Time::Now(), 0, 0, GURL(), history::RedirectList(), | 59 GURL(), base::Time::Now(), 0, 0, GURL(), history::RedirectList(), |
60 PageTransition::TYPED, history::SOURCE_SYNCED, false)); | 60 PageTransition::TYPED, history::SOURCE_SYNCED, false)); |
61 EXPECT_FALSE(test_tab_contents_delegate_->ShouldAddNavigationToHistory( | 61 EXPECT_FALSE(test_tab_contents_delegate_->ShouldAddNavigationToHistory( |
62 *should_add_args, NavigationType::NEW_PAGE)); | 62 *should_add_args, NavigationType::NEW_PAGE)); |
63 test_tab_contents_delegate_->NavigationStateChanged(NULL, 0); | 63 test_tab_contents_delegate_->NavigationStateChanged(NULL, 0); |
64 test_tab_contents_delegate_->ActivateContents(NULL); | 64 test_tab_contents_delegate_->ActivateContents(NULL); |
65 test_tab_contents_delegate_->LoadingStateChanged(NULL); | 65 test_tab_contents_delegate_->LoadingStateChanged(NULL); |
66 test_tab_contents_delegate_->CloseContents(NULL); | 66 test_tab_contents_delegate_->CloseContents(NULL); |
67 test_tab_contents_delegate_->UpdateTargetURL(NULL, GURL()); | 67 test_tab_contents_delegate_->UpdateTargetURL(NULL, 0, GURL()); |
68 test_tab_contents_delegate_->MoveContents(NULL, gfx::Rect()); | 68 test_tab_contents_delegate_->MoveContents(NULL, gfx::Rect()); |
69 EXPECT_EQ(0, browser()->tab_count()); | 69 EXPECT_EQ(0, browser()->tab_count()); |
70 EXPECT_EQ(1U, BrowserList::size()); | 70 EXPECT_EQ(1U, BrowserList::size()); |
71 } | 71 } |
72 | 72 |
73 TEST_F(HtmlDialogTabContentsDelegateTest, OpenURLFromTabTest) { | 73 TEST_F(HtmlDialogTabContentsDelegateTest, OpenURLFromTabTest) { |
74 test_tab_contents_delegate_->OpenURLFromTab( | 74 test_tab_contents_delegate_->OpenURLFromTab( |
75 NULL, GURL(chrome::kAboutBlankURL), GURL(), | 75 NULL, GURL(chrome::kAboutBlankURL), GURL(), |
76 NEW_FOREGROUND_TAB, PageTransition::LINK); | 76 NEW_FOREGROUND_TAB, PageTransition::LINK); |
77 // This should create a new foreground tab in the existing browser. | 77 // This should create a new foreground tab in the existing browser. |
(...skipping 19 matching lines...) Expand all Loading... |
97 test_tab_contents_delegate_->OpenURLFromTab( | 97 test_tab_contents_delegate_->OpenURLFromTab( |
98 NULL, GURL(chrome::kAboutBlankURL), GURL(), | 98 NULL, GURL(chrome::kAboutBlankURL), GURL(), |
99 NEW_FOREGROUND_TAB, PageTransition::LINK); | 99 NEW_FOREGROUND_TAB, PageTransition::LINK); |
100 test_tab_contents_delegate_->AddNewContents(NULL, NULL, NEW_FOREGROUND_TAB, | 100 test_tab_contents_delegate_->AddNewContents(NULL, NULL, NEW_FOREGROUND_TAB, |
101 gfx::Rect(), false); | 101 gfx::Rect(), false); |
102 EXPECT_EQ(0, browser()->tab_count()); | 102 EXPECT_EQ(0, browser()->tab_count()); |
103 EXPECT_EQ(1U, BrowserList::size()); | 103 EXPECT_EQ(1U, BrowserList::size()); |
104 } | 104 } |
105 | 105 |
106 } // namespace | 106 } // namespace |
OLD | NEW |