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

Side by Side Diff: chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc

Issue 12276010: Factor out uses of the WebContentsModalDialog interface from platform-independent code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove incorrect override Created 7 years, 10 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/test/ui/ui_test.h" 5 #include "chrome/test/ui/ui_test.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 WebContents* web_contents = 63 WebContents* web_contents =
64 browser()->tab_strip_model()->GetActiveWebContents(); 64 browser()->tab_strip_model()->GetActiveWebContents();
65 ASSERT_TRUE(web_contents); 65 ASSERT_TRUE(web_contents);
66 66
67 ConstrainedWebDialogDelegate* dialog_delegate = 67 ConstrainedWebDialogDelegate* dialog_delegate =
68 CreateConstrainedWebDialog(browser()->profile(), 68 CreateConstrainedWebDialog(browser()->profile(),
69 delegate, 69 delegate,
70 NULL, 70 NULL,
71 web_contents); 71 web_contents);
72 ASSERT_TRUE(dialog_delegate); 72 ASSERT_TRUE(dialog_delegate);
73 EXPECT_TRUE(dialog_delegate->GetWindow()); 73 EXPECT_TRUE(dialog_delegate->GetNativeDialog());
74 EXPECT_TRUE(IsShowingWebContentsModalDialog(web_contents)); 74 EXPECT_TRUE(IsShowingWebContentsModalDialog(web_contents));
75 } 75 }
76 76
77 // Tests that ReleaseWebContentsOnDialogClose() works. 77 // Tests that ReleaseWebContentsOnDialogClose() works.
78 IN_PROC_BROWSER_TEST_F(ConstrainedWebDialogBrowserTest, 78 IN_PROC_BROWSER_TEST_F(ConstrainedWebDialogBrowserTest,
79 ReleaseWebContentsOnDialogClose) { 79 ReleaseWebContentsOnDialogClose) {
80 // The delegate deletes itself. 80 // The delegate deletes itself.
81 WebDialogDelegate* delegate = new ui::test::TestWebDialogDelegate( 81 WebDialogDelegate* delegate = new ui::test::TestWebDialogDelegate(
82 GURL(chrome::kChromeUIConstrainedHTMLTestURL)); 82 GURL(chrome::kChromeUIConstrainedHTMLTestURL));
83 WebContents* web_contents = 83 WebContents* web_contents =
(...skipping 12 matching lines...) Expand all
96 96
97 ConstrainedWebDialogBrowserTestObserver observer(new_tab.get()); 97 ConstrainedWebDialogBrowserTestObserver observer(new_tab.get());
98 dialog_delegate->ReleaseWebContentsOnDialogClose(); 98 dialog_delegate->ReleaseWebContentsOnDialogClose();
99 dialog_delegate->OnDialogCloseFromWebUI(); 99 dialog_delegate->OnDialogCloseFromWebUI();
100 100
101 ASSERT_FALSE(observer.contents_destroyed()); 101 ASSERT_FALSE(observer.contents_destroyed());
102 EXPECT_FALSE(IsShowingWebContentsModalDialog(web_contents)); 102 EXPECT_FALSE(IsShowingWebContentsModalDialog(web_contents));
103 new_tab.reset(); 103 new_tab.reset();
104 EXPECT_TRUE(observer.contents_destroyed()); 104 EXPECT_TRUE(observer.contents_destroyed());
105 } 105 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698