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

Side by Side Diff: chrome/test/media_router/media_router_integration_browsertest.cc

Issue 1228863005: [MediaRouter] The minimal change to make everything build on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the include for MediaRouterDialogControllerImpl Created 5 years, 5 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
OLDNEW
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 "chrome/test/media_router/media_router_integration_browsertest.h" 5 #include "chrome/test/media_router/media_router_integration_browsertest.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/json/json_file_value_serializer.h" 8 #include "base/json/json_file_value_serializer.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/ui/browser_finder.h" 14 #include "chrome/browser/ui/browser_finder.h"
15 #include "chrome/browser/ui/tabs/tab_strip_model.h" 15 #include "chrome/browser/ui/tabs/tab_strip_model.h"
16 #include "chrome/browser/ui/webui/media_router/media_router_dialog_controller.h" 16 #include "chrome/browser/ui/webui/media_router/media_router_dialog_controller_im pl.h"
17 #include "chrome/test/base/ui_test_utils.h" 17 #include "chrome/test/base/ui_test_utils.h"
18 #include "content/public/test/browser_test_utils.h" 18 #include "content/public/test/browser_test_utils.h"
19 #include "content/public/test/test_navigation_observer.h" 19 #include "content/public/test/test_navigation_observer.h"
20 #include "content/public/test/test_utils.h" 20 #include "content/public/test/test_utils.h"
21 #include "net/base/filename_util.h" 21 #include "net/base/filename_util.h"
22 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
23 23
24 namespace { 24 namespace {
25 // The path relative to <chromium src>/out/<build config> for media router 25 // The path relative to <chromium src>/out/<build config> for media router
26 // browser test resources. 26 // browser test resources.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 void MediaRouterIntegrationBrowserTest::OpenTestPage( 67 void MediaRouterIntegrationBrowserTest::OpenTestPage(
68 base::FilePath::StringPieceType file_name) { 68 base::FilePath::StringPieceType file_name) {
69 base::FilePath full_path = GetResourceFile(file_name); 69 base::FilePath full_path = GetResourceFile(file_name);
70 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(full_path)); 70 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(full_path));
71 } 71 }
72 72
73 void MediaRouterIntegrationBrowserTest::ChooseSink( 73 void MediaRouterIntegrationBrowserTest::ChooseSink(
74 content::WebContents* web_contents, 74 content::WebContents* web_contents,
75 const std::string& sink_id) { 75 const std::string& sink_id) {
76 MediaRouterDialogController* controller = 76 MediaRouterDialogControllerImpl* controller =
77 MediaRouterDialogController::GetOrCreateForWebContents(web_contents); 77 MediaRouterDialogControllerImpl::GetOrCreateForWebContents(web_contents);
78 content::WebContents* dialog_contents = controller->GetMediaRouterDialog(); 78 content::WebContents* dialog_contents = controller->GetMediaRouterDialog();
79 ASSERT_TRUE(dialog_contents); 79 ASSERT_TRUE(dialog_contents);
80 std::string script = base::StringPrintf( 80 std::string script = base::StringPrintf(
81 "window.document.getElementById('media-router-container')." 81 "window.document.getElementById('media-router-container')."
82 "showOrCreateRoute_({'id': '%s', 'name': ''}, null)", 82 "showOrCreateRoute_({'id': '%s', 'name': ''}, null)",
83 sink_id.c_str()); 83 sink_id.c_str());
84 ASSERT_TRUE(content::ExecuteScript(dialog_contents, script)); 84 ASSERT_TRUE(content::ExecuteScript(dialog_contents, script));
85 } 85 }
86 86
87 void MediaRouterIntegrationBrowserTest::SetTestData( 87 void MediaRouterIntegrationBrowserTest::SetTestData(
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 ExecuteJavaScriptAPI(web_contents, "waitUntilDeviceAvailable();"); 155 ExecuteJavaScriptAPI(web_contents, "waitUntilDeviceAvailable();");
156 content::TestNavigationObserver test_navigation_observer(web_contents, 1); 156 content::TestNavigationObserver test_navigation_observer(web_contents, 1);
157 test_navigation_observer.StartWatchingNewWebContents(); 157 test_navigation_observer.StartWatchingNewWebContents();
158 ExecuteJavaScriptAPI(web_contents, "startSession();"); 158 ExecuteJavaScriptAPI(web_contents, "startSession();");
159 test_navigation_observer.Wait(); 159 test_navigation_observer.Wait();
160 ChooseSink(web_contents, "id1"); 160 ChooseSink(web_contents, "id1");
161 ExecuteJavaScriptAPI(web_contents, "checkSessionFailedToStart();"); 161 ExecuteJavaScriptAPI(web_contents, "checkSessionFailedToStart();");
162 } 162 }
163 163
164 } // namespace media_router 164 } // namespace media_router
OLDNEW
« chrome/chrome_browser_ui.gypi ('K') | « chrome/test/media_router/media_router_e2e_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698