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

Side by Side Diff: chrome/browser/ui/intents/web_intent_inline_disposition_delegate_unittest.cc

Issue 10868072: Make TabContents ctor private; poke hole for existing callers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: all green Created 8 years, 4 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 "chrome/browser/profiles/profile.h" 5 #include "chrome/browser/profiles/profile.h"
6 #include "chrome/browser/ui/browser.h" 6 #include "chrome/browser/ui/browser.h"
7 #include "chrome/browser/ui/intents/web_intent_inline_disposition_delegate.h" 7 #include "chrome/browser/ui/intents/web_intent_inline_disposition_delegate.h"
8 #include "chrome/browser/ui/intents/web_intent_picker.h" 8 #include "chrome/browser/ui/intents/web_intent_picker.h"
9 #include "chrome/browser/ui/tab_contents/tab_contents.h" 9 #include "chrome/browser/ui/tab_contents/tab_contents.h"
10 #include "chrome/test/base/browser_with_test_window_test.h" 10 #include "chrome/test/base/browser_with_test_window_test.h"
(...skipping 14 matching lines...) Expand all
25 }; 25 };
26 26
27 class WebIntentInlineDispositionBrowserTest 27 class WebIntentInlineDispositionBrowserTest
28 : public BrowserWithTestWindowTest { 28 : public BrowserWithTestWindowTest {
29 public: 29 public:
30 virtual void SetUp() { 30 virtual void SetUp() {
31 BrowserWithTestWindowTest::SetUp(); 31 BrowserWithTestWindowTest::SetUp();
32 32
33 content::WebContents* contents = content::WebContents::Create( 33 content::WebContents* contents = content::WebContents::Create(
34 browser()->profile(), NULL, MSG_ROUTING_NONE, NULL); 34 browser()->profile(), NULL, MSG_ROUTING_NONE, NULL);
35 tab_contents_.reset(new TabContents(contents)); 35 tab_contents_.reset(TabContents::Factory::CreateTabContents(contents));
36 delegate_.reset(new WebIntentInlineDispositionDelegate( 36 delegate_.reset(new WebIntentInlineDispositionDelegate(
37 &mock_, contents, browser())); 37 &mock_, contents, browser()));
38 } 38 }
39 39
40 protected: 40 protected:
41 TestingProfile profile_; 41 TestingProfile profile_;
42 scoped_ptr<TabContents> tab_contents_; 42 scoped_ptr<TabContents> tab_contents_;
43 scoped_ptr<WebIntentInlineDispositionDelegate> delegate_; 43 scoped_ptr<WebIntentInlineDispositionDelegate> delegate_;
44 WebIntentPickerMock mock_; 44 WebIntentPickerMock mock_;
45 }; 45 };
46 46
47 // Verifies delegate's OpenURLFromTab works. This allows navigation inside 47 // Verifies delegate's OpenURLFromTab works. This allows navigation inside
48 // web intents picker. 48 // web intents picker.
49 TEST_F(WebIntentInlineDispositionBrowserTest, OpenURLFromTabTest) { 49 TEST_F(WebIntentInlineDispositionBrowserTest, OpenURLFromTabTest) {
50 content::WebContents* source = delegate_->OpenURLFromTab( 50 content::WebContents* source = delegate_->OpenURLFromTab(
51 tab_contents_->web_contents(), 51 tab_contents_->web_contents(),
52 content::OpenURLParams(GURL(chrome::kAboutBlankURL), content::Referrer(), 52 content::OpenURLParams(GURL(chrome::kAboutBlankURL), content::Referrer(),
53 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false)); 53 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false));
54 54
55 // Ensure OpenURLFromTab loaded about::blank in |web_contents_|. 55 // Ensure OpenURLFromTab loaded about::blank in |web_contents_|.
56 ASSERT_EQ(tab_contents_->web_contents(), source); 56 ASSERT_EQ(tab_contents_->web_contents(), source);
57 EXPECT_EQ(GURL(chrome::kAboutBlankURL).spec(), source->GetURL().spec()); 57 EXPECT_EQ(GURL(chrome::kAboutBlankURL).spec(), source->GetURL().spec());
58 } 58 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/web_intent_picker_gtk.cc ('k') | chrome/browser/ui/panels/base_panel_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698