| Index: chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc
|
| diff --git a/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc b/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc
|
| index f7d95384e99e81aa8c8d2e112eaf22d6e9e158fc..27a0ea5750016b8481bc92c81ae0928da47bd3b4 100644
|
| --- a/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc
|
| +++ b/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc
|
| @@ -9,16 +9,15 @@
|
| #include "chrome/browser/ui/browser_tabstrip.h"
|
| #include "chrome/browser/ui/constrained_window_tab_helper.h"
|
| #include "chrome/browser/ui/tab_contents/tab_contents.h"
|
| +#include "chrome/browser/ui/webui/constrained_web_dialog_ui.h"
|
| #include "chrome/browser/ui/webui/test_web_dialog_delegate.h"
|
| #include "chrome/common/url_constants.h"
|
| #include "chrome/test/base/in_process_browser_test.h"
|
| #include "chrome/test/base/ui_test_utils.h"
|
| #include "content/public/browser/web_contents.h"
|
| #include "content/public/browser/web_contents_observer.h"
|
| -#include "ui/web_dialogs/constrained_web_dialog_ui.h"
|
|
|
| using content::WebContents;
|
| -using ui::ConstrainedWebDialogDelegate;
|
| using ui::WebDialogDelegate;
|
|
|
| namespace {
|
| @@ -49,10 +48,9 @@ class ConstrainedWebDialogBrowserTest : public InProcessBrowserTest {
|
| ConstrainedWebDialogBrowserTest() {}
|
|
|
| protected:
|
| - size_t GetConstrainedWindowCount(TabContents* tab_contents) const {
|
| + size_t GetConstrainedWindowCount(WebContents* web_contents) const {
|
| ConstrainedWindowTabHelper* constrained_window_tab_helper =
|
| - ConstrainedWindowTabHelper::FromWebContents
|
| - (tab_contents->web_contents());
|
| + ConstrainedWindowTabHelper::FromWebContents(web_contents);
|
| return constrained_window_tab_helper->constrained_window_count();
|
| }
|
| };
|
| @@ -62,17 +60,17 @@ IN_PROC_BROWSER_TEST_F(ConstrainedWebDialogBrowserTest, BasicTest) {
|
| // The delegate deletes itself.
|
| WebDialogDelegate* delegate = new test::TestWebDialogDelegate(
|
| GURL(chrome::kChromeUIConstrainedHTMLTestURL));
|
| - TabContents* tab_contents = chrome::GetActiveTabContents(browser());
|
| - ASSERT_TRUE(tab_contents);
|
| + WebContents* web_contents = chrome::GetActiveWebContents(browser());
|
| + ASSERT_TRUE(web_contents);
|
|
|
| ConstrainedWebDialogDelegate* dialog_delegate =
|
| - ui::CreateConstrainedWebDialog(browser()->profile(),
|
| - delegate,
|
| - NULL,
|
| - tab_contents);
|
| + CreateConstrainedWebDialog(browser()->profile(),
|
| + delegate,
|
| + NULL,
|
| + web_contents);
|
| ASSERT_TRUE(dialog_delegate);
|
| EXPECT_TRUE(dialog_delegate->window());
|
| - EXPECT_EQ(1U, GetConstrainedWindowCount(tab_contents));
|
| + EXPECT_EQ(1U, GetConstrainedWindowCount(web_contents));
|
| }
|
|
|
| // Tests that ReleaseTabContentsOnDialogClose() works.
|
| @@ -81,25 +79,25 @@ IN_PROC_BROWSER_TEST_F(ConstrainedWebDialogBrowserTest,
|
| // The delegate deletes itself.
|
| WebDialogDelegate* delegate = new test::TestWebDialogDelegate(
|
| GURL(chrome::kChromeUIConstrainedHTMLTestURL));
|
| - TabContents* tab_contents = chrome::GetActiveTabContents(browser());
|
| - ASSERT_TRUE(tab_contents);
|
| + WebContents* web_contents = chrome::GetActiveWebContents(browser());
|
| + ASSERT_TRUE(web_contents);
|
|
|
| ConstrainedWebDialogDelegate* dialog_delegate =
|
| - ui::CreateConstrainedWebDialog(browser()->profile(),
|
| - delegate,
|
| - NULL,
|
| - tab_contents);
|
| + CreateConstrainedWebDialog(browser()->profile(),
|
| + delegate,
|
| + NULL,
|
| + web_contents);
|
| ASSERT_TRUE(dialog_delegate);
|
| scoped_ptr<TabContents> new_tab(dialog_delegate->tab());
|
| ASSERT_TRUE(new_tab.get());
|
| - ASSERT_EQ(1U, GetConstrainedWindowCount(tab_contents));
|
| + ASSERT_EQ(1U, GetConstrainedWindowCount(web_contents));
|
|
|
| ConstrainedWebDialogBrowserTestObserver observer(new_tab->web_contents());
|
| dialog_delegate->ReleaseTabContentsOnDialogClose();
|
| dialog_delegate->OnDialogCloseFromWebUI();
|
|
|
| ASSERT_FALSE(observer.tab_destroyed());
|
| - EXPECT_EQ(0U, GetConstrainedWindowCount(tab_contents));
|
| + EXPECT_EQ(0U, GetConstrainedWindowCount(web_contents));
|
| new_tab.reset();
|
| EXPECT_TRUE(observer.tab_destroyed());
|
| }
|
|
|