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 "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" |
11 #include "chrome/test/base/testing_profile.h" | 11 #include "chrome/test/base/testing_profile.h" |
12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
13 #include "content/public/common/url_constants.h" | 13 #include "content/public/common/url_constants.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 class WebIntentPickerMock : public WebIntentPicker { | 16 class WebIntentPickerMock : public WebIntentPicker { |
17 public: | 17 public: |
18 virtual void Close() OVERRIDE {} | 18 virtual void Close() OVERRIDE {} |
19 virtual void SetActionString(const string16& action) OVERRIDE {} | 19 virtual void SetActionString(const string16& action) OVERRIDE {} |
| 20 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE {} |
| 21 virtual void OnExtensionInstallFailure(const std::string& id) OVERRIDE {} |
| 22 virtual void OnInlineDispositionAutoResize(const gfx::Size& size) OVERRIDE {} |
| 23 virtual void OnPendingAsyncCompleted() OVERRIDE {} |
| 24 |
20 }; | 25 }; |
21 | 26 |
22 class WebIntentInlineDispositionBrowserTest | 27 class WebIntentInlineDispositionBrowserTest |
23 : public BrowserWithTestWindowTest { | 28 : public BrowserWithTestWindowTest { |
24 public: | 29 public: |
25 virtual void SetUp() { | 30 virtual void SetUp() { |
26 BrowserWithTestWindowTest::SetUp(); | 31 BrowserWithTestWindowTest::SetUp(); |
27 | 32 |
28 content::WebContents* contents = content::WebContents::Create( | 33 content::WebContents* contents = content::WebContents::Create( |
29 browser()->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); | 34 browser()->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); |
(...skipping 14 matching lines...) Expand all Loading... |
44 TEST_F(WebIntentInlineDispositionBrowserTest, OpenURLFromTabTest) { | 49 TEST_F(WebIntentInlineDispositionBrowserTest, OpenURLFromTabTest) { |
45 content::WebContents* source = delegate_->OpenURLFromTab( | 50 content::WebContents* source = delegate_->OpenURLFromTab( |
46 tab_contents_->web_contents(), | 51 tab_contents_->web_contents(), |
47 content::OpenURLParams(GURL(chrome::kAboutBlankURL), content::Referrer(), | 52 content::OpenURLParams(GURL(chrome::kAboutBlankURL), content::Referrer(), |
48 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false)); | 53 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false)); |
49 | 54 |
50 // Ensure OpenURLFromTab loaded about::blank in |web_contents_|. | 55 // Ensure OpenURLFromTab loaded about::blank in |web_contents_|. |
51 ASSERT_EQ(tab_contents_->web_contents(), source); | 56 ASSERT_EQ(tab_contents_->web_contents(), source); |
52 EXPECT_EQ(GURL(chrome::kAboutBlankURL).spec(), source->GetURL().spec()); | 57 EXPECT_EQ(GURL(chrome::kAboutBlankURL).spec(), source->GetURL().spec()); |
53 } | 58 } |
OLD | NEW |