| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/threading/thread_task_runner_handle.h" | 6 #include "base/threading/thread_task_runner_handle.h" |
| 7 #include "chrome/browser/extensions/browser_action_test_util.h" | 7 #include "chrome/browser/extensions/browser_action_test_util.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 OpenDialogWithMediaRouterAction) { | 109 OpenDialogWithMediaRouterAction) { |
| 110 // We start off at about:blank page. | 110 // We start off at about:blank page. |
| 111 // Make sure there is 1 tab and media router is enabled. | 111 // Make sure there is 1 tab and media router is enabled. |
| 112 ASSERT_EQ(1, browser()->tab_strip_model()->count()); | 112 ASSERT_EQ(1, browser()->tab_strip_model()->count()); |
| 113 | 113 |
| 114 OpenMediaRouterDialogAndWaitForNewWebContents(); | 114 OpenMediaRouterDialogAndWaitForNewWebContents(); |
| 115 | 115 |
| 116 // Reload the browser and wait. | 116 // Reload the browser and wait. |
| 117 content::TestNavigationObserver reload_observer( | 117 content::TestNavigationObserver reload_observer( |
| 118 browser()->tab_strip_model()->GetActiveWebContents()); | 118 browser()->tab_strip_model()->GetActiveWebContents()); |
| 119 chrome::Reload(browser(), CURRENT_TAB); | 119 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); |
| 120 reload_observer.Wait(); | 120 reload_observer.Wait(); |
| 121 | 121 |
| 122 // The reload should have removed the previously created dialog. | 122 // The reload should have removed the previously created dialog. |
| 123 // We expect a new dialog WebContents to be created by calling this. | 123 // We expect a new dialog WebContents to be created by calling this. |
| 124 OpenMediaRouterDialogAndWaitForNewWebContents(); | 124 OpenMediaRouterDialogAndWaitForNewWebContents(); |
| 125 | 125 |
| 126 // Navigate away. | 126 // Navigate away. |
| 127 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 127 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
| 128 | 128 |
| 129 // The navigation should have removed the previously created dialog. | 129 // The navigation should have removed the previously created dialog. |
| 130 // We expect a new dialog WebContents to be created by calling this. | 130 // We expect a new dialog WebContents to be created by calling this. |
| 131 OpenMediaRouterDialogAndWaitForNewWebContents(); | 131 OpenMediaRouterDialogAndWaitForNewWebContents(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace media_router | 134 } // namespace media_router |
| OLD | NEW |