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

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

Issue 23815006: [Cleanup] rename WebContentsModalDialogManager::IsShowingDialog() to IsDialogActive() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 3 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
« no previous file with comments | « chrome/browser/apps/app_browsertest.cc ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/chrome_notification_types.h" 6 #include "chrome/browser/chrome_notification_types.h"
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" 8 #include "chrome/browser/ui/tabs/tab_strip_model.h"
9 #include "chrome/common/net/url_fixer_upper.h" 9 #include "chrome/common/net/url_fixer_upper.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
(...skipping 24 matching lines...) Expand all
35 35
36 // Try to reload it twice, checking for repost. 36 // Try to reload it twice, checking for repost.
37 content::WebContents* web_contents = 37 content::WebContents* web_contents =
38 browser()->tab_strip_model()->GetActiveWebContents(); 38 browser()->tab_strip_model()->GetActiveWebContents();
39 web_contents->GetController().Reload(true); 39 web_contents->GetController().Reload(true);
40 web_contents->GetController().Reload(true); 40 web_contents->GetController().Reload(true);
41 41
42 // There should only be one dialog open. 42 // There should only be one dialog open.
43 WebContentsModalDialogManager* web_contents_modal_dialog_manager = 43 WebContentsModalDialogManager* web_contents_modal_dialog_manager =
44 WebContentsModalDialogManager::FromWebContents(web_contents); 44 WebContentsModalDialogManager::FromWebContents(web_contents);
45 EXPECT_TRUE(web_contents_modal_dialog_manager->IsShowingDialog()); 45 EXPECT_TRUE(web_contents_modal_dialog_manager->IsDialogActive());
46 46
47 // Navigate away from the page (this is when the test usually crashes). 47 // Navigate away from the page (this is when the test usually crashes).
48 ui_test_utils::NavigateToURL(browser(), test_server()->GetURL("bar")); 48 ui_test_utils::NavigateToURL(browser(), test_server()->GetURL("bar"));
49 49
50 // The dialog should've been closed. 50 // The dialog should've been closed.
51 EXPECT_FALSE(web_contents_modal_dialog_manager->IsShowingDialog()); 51 EXPECT_FALSE(web_contents_modal_dialog_manager->IsDialogActive());
52 } 52 }
53 53
54 // If becomes flaky, disable on Windows and use http://crbug.com/47228 54 // If becomes flaky, disable on Windows and use http://crbug.com/47228
55 IN_PROC_BROWSER_TEST_F(RepostFormWarningTest, TestLoginAfterRepost) { 55 IN_PROC_BROWSER_TEST_F(RepostFormWarningTest, TestLoginAfterRepost) {
56 ASSERT_TRUE(test_server()->Start()); 56 ASSERT_TRUE(test_server()->Start());
57 57
58 // Load a form. 58 // Load a form.
59 ui_test_utils::NavigateToURL( 59 ui_test_utils::NavigateToURL(
60 browser(), test_server()->GetURL("files/form.html")); 60 browser(), test_server()->GetURL("files/form.html"));
61 // Submit it. 61 // Submit it.
(...skipping 22 matching lines...) Expand all
84 84
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::TestNavigationObserver navigation_observer(web_contents); 88 content::TestNavigationObserver navigation_observer(web_contents);
89 browser()->OpenURL(content::OpenURLParams( 89 browser()->OpenURL(content::OpenURLParams(
90 test_server()->GetURL("bar"), content::Referrer(), CURRENT_TAB, 90 test_server()->GetURL("bar"), content::Referrer(), CURRENT_TAB,
91 content::PAGE_TRANSITION_TYPED, false)); 91 content::PAGE_TRANSITION_TYPED, false));
92 navigation_observer.Wait(); 92 navigation_observer.Wait();
93 } 93 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/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