Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Side by Side Diff: chrome/browser/ui/webui/web_dialog_web_contents_delegate_unittest.cc

Issue 10978016: Remove two functions on WebContentsDelegate which didn't belong in content. They were only called f… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: nits and fixed prerender browser tests Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 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 content::PAGE_TRANSITION_TYPED, history::SOURCE_SYNCED, false); 68 content::PAGE_TRANSITION_TYPED, history::SOURCE_SYNCED, false);
69 EXPECT_FALSE(test_web_contents_delegate_->ShouldAddNavigationToHistory(
70 should_add_args, content::NAVIGATION_TYPE_NEW_PAGE));
71 test_web_contents_delegate_->NavigationStateChanged(NULL, 0); 69 test_web_contents_delegate_->NavigationStateChanged(NULL, 0);
72 test_web_contents_delegate_->ActivateContents(NULL); 70 test_web_contents_delegate_->ActivateContents(NULL);
73 test_web_contents_delegate_->LoadingStateChanged(NULL); 71 test_web_contents_delegate_->LoadingStateChanged(NULL);
74 test_web_contents_delegate_->CloseContents(NULL); 72 test_web_contents_delegate_->CloseContents(NULL);
75 test_web_contents_delegate_->UpdateTargetURL(NULL, 0, GURL()); 73 test_web_contents_delegate_->UpdateTargetURL(NULL, 0, GURL());
76 test_web_contents_delegate_->MoveContents(NULL, gfx::Rect()); 74 test_web_contents_delegate_->MoveContents(NULL, gfx::Rect());
77 EXPECT_EQ(0, browser()->tab_count()); 75 EXPECT_EQ(0, browser()->tab_count());
78 EXPECT_EQ(1U, BrowserList::size()); 76 EXPECT_EQ(1U, BrowserList::size());
79 } 77 }
80 78
(...skipping 24 matching lines...) Expand all
105 test_web_contents_delegate_->OpenURLFromTab( 103 test_web_contents_delegate_->OpenURLFromTab(
106 NULL, OpenURLParams(GURL(chrome::kAboutBlankURL), Referrer(), 104 NULL, OpenURLParams(GURL(chrome::kAboutBlankURL), Referrer(),
107 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false)); 105 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false));
108 test_web_contents_delegate_->AddNewContents(NULL, NULL, NEW_FOREGROUND_TAB, 106 test_web_contents_delegate_->AddNewContents(NULL, NULL, NEW_FOREGROUND_TAB,
109 gfx::Rect(), false, NULL); 107 gfx::Rect(), false, NULL);
110 EXPECT_EQ(0, browser()->tab_count()); 108 EXPECT_EQ(0, browser()->tab_count());
111 EXPECT_EQ(1U, BrowserList::size()); 109 EXPECT_EQ(1U, BrowserList::size());
112 } 110 }
113 111
114 } // namespace 112 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698