| 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 "chrome/test/media_router/media_router_integration_browsertest.h" | 5 #include "chrome/test/media_router/media_router_integration_browsertest.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 } | 242 } |
| 243 | 243 |
| 244 void MediaRouterIntegrationBrowserTest::SetTestData( | 244 void MediaRouterIntegrationBrowserTest::SetTestData( |
| 245 base::FilePath::StringPieceType test_data_file) { | 245 base::FilePath::StringPieceType test_data_file) { |
| 246 base::FilePath full_path = GetResourceFile(test_data_file); | 246 base::FilePath full_path = GetResourceFile(test_data_file); |
| 247 JSONFileValueDeserializer deserializer(full_path); | 247 JSONFileValueDeserializer deserializer(full_path); |
| 248 int error_code = 0; | 248 int error_code = 0; |
| 249 std::string error_message; | 249 std::string error_message; |
| 250 std::unique_ptr<base::Value> value = | 250 std::unique_ptr<base::Value> value = |
| 251 deserializer.Deserialize(&error_code, &error_message); | 251 deserializer.Deserialize(&error_code, &error_message); |
| 252 CHECK(value.get()) << "Deserialize failed: " << error_message; | 252 // Deserialize failed. |
| 253 CHECK(value.get()); |
| 253 std::string test_data_str; | 254 std::string test_data_str; |
| 254 ASSERT_TRUE(base::JSONWriter::Write(*value, &test_data_str)); | 255 ASSERT_TRUE(base::JSONWriter::Write(*value, &test_data_str)); |
| 255 ExecuteScriptInBackgroundPageNoWait( | 256 ExecuteScriptInBackgroundPageNoWait( |
| 256 extension_id_, | 257 extension_id_, |
| 257 base::StringPrintf("localStorage['testdata'] = '%s'", | 258 base::StringPrintf("localStorage['testdata'] = '%s'", |
| 258 test_data_str.c_str())); | 259 test_data_str.c_str())); |
| 259 } | 260 } |
| 260 | 261 |
| 261 content::WebContents* MediaRouterIntegrationBrowserTest::OpenMRDialog( | 262 content::WebContents* MediaRouterIntegrationBrowserTest::OpenMRDialog( |
| 262 content::WebContents* web_contents) { | 263 content::WebContents* web_contents) { |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 | 630 |
| 630 MediaRouterDialogControllerImpl* controller = | 631 MediaRouterDialogControllerImpl* controller = |
| 631 MediaRouterDialogControllerImpl::GetOrCreateForWebContents(web_contents); | 632 MediaRouterDialogControllerImpl::GetOrCreateForWebContents(web_contents); |
| 632 EXPECT_TRUE(controller->IsShowingMediaRouterDialog()); | 633 EXPECT_TRUE(controller->IsShowingMediaRouterDialog()); |
| 633 WaitUntilSinkDiscoveredOnUI(); | 634 WaitUntilSinkDiscoveredOnUI(); |
| 634 controller->HideMediaRouterDialog(); | 635 controller->HideMediaRouterDialog(); |
| 635 CheckStartFailed(web_contents, "NotFoundError", "No screens found."); | 636 CheckStartFailed(web_contents, "NotFoundError", "No screens found."); |
| 636 } | 637 } |
| 637 | 638 |
| 638 } // namespace media_router | 639 } // namespace media_router |
| OLD | NEW |