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

Side by Side Diff: chrome/browser/repost_form_warning_browsertest.cc

Issue 11647017: Rename platform-independent ConstrainedWindow types to WebContentsModalDialog types (part 1) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: stage changes to preserve history Created 8 years 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/app/chrome_command_ids.h" 5 #include "chrome/app/chrome_command_ids.h"
6 #include "chrome/browser/net/url_fixer_upper.h" 6 #include "chrome/browser/net/url_fixer_upper.h"
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/browser_tabstrip.h" 8 #include "chrome/browser/ui/browser_tabstrip.h"
9 #include "chrome/browser/ui/constrained_window_tab_helper.h" 9 #include "chrome/browser/ui/constrained_window_tab_helper.h"
10 #include "chrome/common/chrome_notification_types.h" 10 #include "chrome/common/chrome_notification_types.h"
(...skipping 22 matching lines...) Expand all
33 33
34 // Try to reload it twice, checking for repost. 34 // Try to reload it twice, checking for repost.
35 content::WebContents* web_contents = chrome::GetActiveWebContents(browser()); 35 content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
36 web_contents->GetController().Reload(true); 36 web_contents->GetController().Reload(true);
37 web_contents->GetController().Reload(true); 37 web_contents->GetController().Reload(true);
38 38
39 // There should only be one dialog open. 39 // There should only be one dialog open.
40 ConstrainedWindowTabHelper* constrained_window_tab_helper = 40 ConstrainedWindowTabHelper* constrained_window_tab_helper =
41 ConstrainedWindowTabHelper::FromWebContents(web_contents); 41 ConstrainedWindowTabHelper::FromWebContents(web_contents);
42 size_t num_constrained_windows = 42 size_t num_constrained_windows =
43 constrained_window_tab_helper->constrained_window_count(); 43 constrained_window_tab_helper->dialog_count();
44 EXPECT_EQ(1u, num_constrained_windows); 44 EXPECT_EQ(1u, num_constrained_windows);
45 45
46 // Navigate away from the page (this is when the test usually crashes). 46 // Navigate away from the page (this is when the test usually crashes).
47 ui_test_utils::NavigateToURL(browser(), test_server()->GetURL("bar")); 47 ui_test_utils::NavigateToURL(browser(), test_server()->GetURL("bar"));
48 48
49 // The dialog should've been closed. 49 // The dialog should've been closed.
50 num_constrained_windows = 50 num_constrained_windows =
51 constrained_window_tab_helper->constrained_window_count(); 51 constrained_window_tab_helper->dialog_count();
52 EXPECT_EQ(0u, num_constrained_windows); 52 EXPECT_EQ(0u, num_constrained_windows);
53 } 53 }
54 54
55 // If becomes flaky, disable on Windows and use http://crbug.com/47228 55 // If becomes flaky, disable on Windows and use http://crbug.com/47228
56 IN_PROC_BROWSER_TEST_F(RepostFormWarningTest, TestLoginAfterRepost) { 56 IN_PROC_BROWSER_TEST_F(RepostFormWarningTest, TestLoginAfterRepost) {
57 ASSERT_TRUE(test_server()->Start()); 57 ASSERT_TRUE(test_server()->Start());
58 58
59 // Load a form. 59 // Load a form.
60 ui_test_utils::NavigateToURL( 60 ui_test_utils::NavigateToURL(
61 browser(), test_server()->GetURL("files/form.html")); 61 browser(), test_server()->GetURL("files/form.html"));
(...skipping 23 matching lines...) Expand all
85 // Navigate away from the page. We can't use ui_test_utils:NavigateToURL 85 // Navigate away from the page. We can't use ui_test_utils:NavigateToURL
86 // because that waits for the current page to stop loading first, which won't 86 // because that waits for the current page to stop loading first, which won't
87 // happen while the auth dialog is up. 87 // happen while the auth dialog is up.
88 content::Source<content::NavigationController> source(&controller); 88 content::Source<content::NavigationController> source(&controller);
89 content::TestNavigationObserver navigation_observer(source); 89 content::TestNavigationObserver navigation_observer(source);
90 browser()->OpenURL(content::OpenURLParams( 90 browser()->OpenURL(content::OpenURLParams(
91 test_server()->GetURL("bar"), content::Referrer(), CURRENT_TAB, 91 test_server()->GetURL("bar"), content::Referrer(), CURRENT_TAB,
92 content::PAGE_TRANSITION_TYPED, false)); 92 content::PAGE_TRANSITION_TYPED, false));
93 navigation_observer.Wait(); 93 navigation_observer.Wait();
94 } 94 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/platform_app_browsertest.cc ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698