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 28 matching lines...) Expand all Loading... |
39 : WebDialogWebContentsDelegate(context, new ChromeWebContentsHandler) { | 39 : WebDialogWebContentsDelegate(context, new ChromeWebContentsHandler) { |
40 } | 40 } |
41 ~TestWebContentsDelegate() override {} | 41 ~TestWebContentsDelegate() override {} |
42 | 42 |
43 private: | 43 private: |
44 DISALLOW_COPY_AND_ASSIGN(TestWebContentsDelegate); | 44 DISALLOW_COPY_AND_ASSIGN(TestWebContentsDelegate); |
45 }; | 45 }; |
46 | 46 |
47 class WebDialogWebContentsDelegateTest : public BrowserWithTestWindowTest { | 47 class WebDialogWebContentsDelegateTest : public BrowserWithTestWindowTest { |
48 public: | 48 public: |
49 virtual void SetUp() { | 49 void SetUp() override { |
50 BrowserWithTestWindowTest::SetUp(); | 50 BrowserWithTestWindowTest::SetUp(); |
51 test_web_contents_delegate_.reset(new TestWebContentsDelegate(profile())); | 51 test_web_contents_delegate_.reset(new TestWebContentsDelegate(profile())); |
52 } | 52 } |
53 | 53 |
54 virtual void TearDown() { | 54 void TearDown() override { |
55 test_web_contents_delegate_.reset(NULL); | 55 test_web_contents_delegate_.reset(NULL); |
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. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 NEW_FOREGROUND_TAB, | 112 NEW_FOREGROUND_TAB, |
113 ui::PAGE_TRANSITION_LINK, | 113 ui::PAGE_TRANSITION_LINK, |
114 false)); | 114 false)); |
115 test_web_contents_delegate_->AddNewContents(NULL, NULL, NEW_FOREGROUND_TAB, | 115 test_web_contents_delegate_->AddNewContents(NULL, NULL, NEW_FOREGROUND_TAB, |
116 gfx::Rect(), false, NULL); | 116 gfx::Rect(), false, NULL); |
117 EXPECT_EQ(0, browser()->tab_strip_model()->count()); | 117 EXPECT_EQ(0, browser()->tab_strip_model()->count()); |
118 EXPECT_EQ(1U, chrome::GetTotalBrowserCount()); | 118 EXPECT_EQ(1U, chrome::GetTotalBrowserCount()); |
119 } | 119 } |
120 | 120 |
121 } // namespace | 121 } // namespace |
OLD | NEW |