diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-15 18:39:49 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-15 18:39:49 +0000 |
commit | 59ec83a226f3243f7ff98aebc078b992498f079e (patch) | |
tree | 9fdabe87a3599ecdd4a390c213a2210fe3c769ae /chrome/browser/ui/constrained_window_tab_helper_unittest.cc | |
parent | c86a6b0641e5030aec8014c841f7763b85fb0370 (diff) | |
download | chromium_src-59ec83a226f3243f7ff98aebc078b992498f079e.zip chromium_src-59ec83a226f3243f7ff98aebc078b992498f079e.tar.gz chromium_src-59ec83a226f3243f7ff98aebc078b992498f079e.tar.bz2 |
Remove TabContents from constrained windows.
BUG=107201
TEST=no visible change
Review URL: https://chromiumcodereview.appspot.com/11111022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161903 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/constrained_window_tab_helper_unittest.cc')
-rw-r--r-- | chrome/browser/ui/constrained_window_tab_helper_unittest.cc | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/chrome/browser/ui/constrained_window_tab_helper_unittest.cc b/chrome/browser/ui/constrained_window_tab_helper_unittest.cc index 81ce431..03fcc70 100644 --- a/chrome/browser/ui/constrained_window_tab_helper_unittest.cc +++ b/chrome/browser/ui/constrained_window_tab_helper_unittest.cc @@ -4,28 +4,32 @@ #include "chrome/browser/ui/constrained_window.h" #include "chrome/browser/ui/constrained_window_tab_helper.h" -#include "chrome/browser/ui/tab_contents/tab_contents.h" -#include "chrome/browser/ui/tab_contents/test_tab_contents.h" +#include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "content/public/test/test_browser_thread.h" #include "testing/gtest/include/gtest/gtest.h" using content::BrowserThread; -class ConstrainedWindowTabHelperUnit : public TabContentsTestHarness { +class ConstrainedWindowTabHelperTest : public ChromeRenderViewHostTestHarness { public: - ConstrainedWindowTabHelperUnit() - : TabContentsTestHarness(), + ConstrainedWindowTabHelperTest() + : ChromeRenderViewHostTestHarness(), ui_thread_(BrowserThread::UI, &message_loop_) { } + virtual void SetUp() { + ChromeRenderViewHostTestHarness::SetUp(); + ConstrainedWindowTabHelper::CreateForWebContents(web_contents()); + } + private: content::TestBrowserThread ui_thread_; }; class ConstrainedWindowCloseTest : public ConstrainedWindow { public: - explicit ConstrainedWindowCloseTest(TabContents* tab_contents) - : tab_contents_(tab_contents) { + explicit ConstrainedWindowCloseTest(content::WebContents* web_contents) + : web_contents_(web_contents) { } virtual void ShowConstrainedWindow() {} @@ -34,18 +38,17 @@ class ConstrainedWindowCloseTest : public ConstrainedWindow { virtual void CloseConstrainedWindow() { ConstrainedWindowTabHelper* constrained_window_tab_helper = - ConstrainedWindowTabHelper::FromWebContents( - tab_contents_->web_contents()); + ConstrainedWindowTabHelper::FromWebContents(web_contents_); constrained_window_tab_helper->WillClose(this); close_count++; } int close_count; - TabContents* tab_contents_; + content::WebContents* web_contents_; }; -TEST_F(ConstrainedWindowTabHelperUnit, ConstrainedWindows) { - ConstrainedWindowCloseTest window(tab_contents()); +TEST_F(ConstrainedWindowTabHelperTest, ConstrainedWindows) { + ConstrainedWindowCloseTest window(web_contents()); window.close_count = 0; ConstrainedWindowTabHelper* constrained_window_tab_helper = ConstrainedWindowTabHelper::FromWebContents(web_contents()); |