| 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/macros.h" | 5 #include "base/macros.h" |
| 6 #include "chrome/browser/ui/browser_commands.h" | 6 #include "chrome/browser/ui/browser_commands.h" |
| 7 #include "chrome/browser/ui/browser_finder.h" | 7 #include "chrome/browser/ui/browser_finder.h" |
| 8 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 8 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 9 #include "chrome/browser/ui/webui/media_router/media_router_dialog_controller_im
pl.h" | 9 #include "chrome/browser/ui/webui/media_router/media_router_dialog_controller_im
pl.h" |
| 10 #include "chrome/browser/ui/webui/media_router/media_router_ui.h" | 10 #include "chrome/browser/ui/webui/media_router/media_router_ui.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 media_router_dialog_ = dialog_controller_->GetMediaRouterDialog(); | 103 media_router_dialog_ = dialog_controller_->GetMediaRouterDialog(); |
| 104 ASSERT_TRUE(media_router_dialog_); | 104 ASSERT_TRUE(media_router_dialog_); |
| 105 | 105 |
| 106 { | 106 { |
| 107 // Wait for the dialog to initialize. | 107 // Wait for the dialog to initialize. |
| 108 TestNavigationObserver nav_observer(media_router_dialog_); | 108 TestNavigationObserver nav_observer(media_router_dialog_); |
| 109 nav_observer.Wait(); | 109 nav_observer.Wait(); |
| 110 | 110 |
| 111 // Refresh and block until dialog WebContents has been destroyed. | 111 // Refresh and block until dialog WebContents has been destroyed. |
| 112 content::WebContentsDestroyedWatcher dialog_watcher(media_router_dialog_); | 112 content::WebContentsDestroyedWatcher dialog_watcher(media_router_dialog_); |
| 113 chrome::Reload(browser(), CURRENT_TAB); | 113 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); |
| 114 dialog_watcher.Wait(); | 114 dialog_watcher.Wait(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 // Verify that dialog has been removed again. | 117 // Verify that dialog has been removed again. |
| 118 EXPECT_FALSE(dialog_controller_->GetMediaRouterDialog()); | 118 EXPECT_FALSE(dialog_controller_->GetMediaRouterDialog()); |
| 119 } | 119 } |
| 120 | 120 |
| 121 IN_PROC_BROWSER_TEST_F(MediaRouterDialogControllerBrowserTest, | 121 IN_PROC_BROWSER_TEST_F(MediaRouterDialogControllerBrowserTest, |
| 122 RenderProcessHost) { | 122 RenderProcessHost) { |
| 123 // New media router dialog is a constrained window, so the number of | 123 // New media router dialog is a constrained window, so the number of |
| (...skipping 10 matching lines...) Expand all Loading... |
| 134 | 134 |
| 135 // Blocks until the dialog WebContents has been destroyed. | 135 // Blocks until the dialog WebContents has been destroyed. |
| 136 rph_watcher.Wait(); | 136 rph_watcher.Wait(); |
| 137 dialog_watcher.Wait(); | 137 dialog_watcher.Wait(); |
| 138 | 138 |
| 139 // Entry has been removed. | 139 // Entry has been removed. |
| 140 EXPECT_FALSE(dialog_controller_->GetMediaRouterDialog()); | 140 EXPECT_FALSE(dialog_controller_->GetMediaRouterDialog()); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace media_router | 143 } // namespace media_router |
| OLD | NEW |