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/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/extensions/browser_action_test_util.h" | 8 #include "chrome/browser/extensions/browser_action_test_util.h" |
9 #include "chrome/browser/media/router/media_router_ui_service.h" | 9 #include "chrome/browser/media/router/media_router_ui_service.h" |
10 #include "chrome/browser/prefs/browser_prefs.h" | 10 #include "chrome/browser/prefs/browser_prefs.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 void OpenMediaRouterDialogAndWaitForNewWebContents() { | 68 void OpenMediaRouterDialogAndWaitForNewWebContents() { |
69 content::TestNavigationObserver nav_observer(NULL); | 69 content::TestNavigationObserver nav_observer(NULL); |
70 nav_observer.StartWatchingNewWebContents(); | 70 nav_observer.StartWatchingNewWebContents(); |
71 | 71 |
72 AppMenuButton* app_menu_button = GetAppMenuButton(); | 72 AppMenuButton* app_menu_button = GetAppMenuButton(); |
73 | 73 |
74 // When the Media Router Action executes, it opens a dialog with web | 74 // When the Media Router Action executes, it opens a dialog with web |
75 // contents to chrome://media-router. | 75 // contents to chrome://media-router. |
76 base::ThreadTaskRunnerHandle::Get()->PostTask( | 76 base::ThreadTaskRunnerHandle::Get()->PostTask( |
77 FROM_HERE, | 77 FROM_HERE, |
78 base::Bind(&MediaRouterUIBrowserTest::ExecuteMediaRouterAction, | 78 base::BindOnce(&MediaRouterUIBrowserTest::ExecuteMediaRouterAction, |
79 base::Unretained(this), app_menu_button)); | 79 base::Unretained(this), app_menu_button)); |
80 | 80 |
81 base::RunLoop run_loop; | 81 base::RunLoop run_loop; |
82 app_menu_button->ShowMenu(false); | 82 app_menu_button->ShowMenu(false); |
83 run_loop.RunUntilIdle(); | 83 run_loop.RunUntilIdle(); |
84 | 84 |
85 nav_observer.Wait(); | 85 nav_observer.Wait(); |
86 EXPECT_FALSE(app_menu_button->IsMenuShowing()); | 86 EXPECT_FALSE(app_menu_button->IsMenuShowing()); |
87 ASSERT_EQ(chrome::kChromeUIMediaRouterURL, | 87 ASSERT_EQ(chrome::kChromeUIMediaRouterURL, |
88 nav_observer.last_navigation_url().spec()); | 88 nav_observer.last_navigation_url().spec()); |
89 nav_observer.StopWatchingNewWebContents(); | 89 nav_observer.StopWatchingNewWebContents(); |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 } | 376 } |
377 | 377 |
378 IN_PROC_BROWSER_TEST_F(MediaRouterUIBrowserTest, | 378 IN_PROC_BROWSER_TEST_F(MediaRouterUIBrowserTest, |
379 MigrateToolbarIconUnshownPref) { | 379 MigrateToolbarIconUnshownPref) { |
380 MigrateToolbarIconPref(false); | 380 MigrateToolbarIconPref(false); |
381 EXPECT_FALSE(MediaRouterActionController::GetAlwaysShowActionPref( | 381 EXPECT_FALSE(MediaRouterActionController::GetAlwaysShowActionPref( |
382 browser()->profile())); | 382 browser()->profile())); |
383 } | 383 } |
384 | 384 |
385 } // namespace media_router | 385 } // namespace media_router |
OLD | NEW |