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

Side by Side Diff: chrome/browser/media/encrypted_media_istypesupported_browsertest.cc

Issue 357413002: Have media content and chrome browser tests load data from media/test/data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: few merge fixes Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/base_switches.h" 8 #include "base/base_switches.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/tabs/tab_strip_model.h" 14 #include "chrome/browser/ui/tabs/tab_strip_model.h"
15 #include "chrome/common/chrome_paths.h" 15 #include "chrome/common/chrome_paths.h"
16 #include "chrome/test/base/in_process_browser_test.h" 16 #include "chrome/test/base/in_process_browser_test.h"
17 #include "chrome/test/base/ui_test_utils.h" 17 #include "chrome/test/base/ui_test_utils.h"
18 #include "content/public/common/content_switches.h" 18 #include "content/public/common/content_switches.h"
19 #include "content/public/test/browser_test_utils.h" 19 #include "content/public/test/browser_test_utils.h"
20 #include "media/base/test_data_util.h"
20 #include "url/gurl.h" 21 #include "url/gurl.h"
21 22
22 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 23 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
23 24
24 #if defined(OS_ANDROID) 25 #if defined(OS_ANDROID)
25 #error This file needs to be updated to run on Android. 26 #error This file needs to be updated to run on Android.
26 #endif 27 #endif
27 28
28 #if defined(USE_PROPRIETARY_CODECS) 29 #if defined(USE_PROPRIETARY_CODECS)
29 #define EXPECT_PROPRIETARY EXPECT_TRUE 30 #define EXPECT_PROPRIETARY EXPECT_TRUE
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 pepper_plugin.append(pepper_type_for_key_system); 218 pepper_plugin.append(pepper_type_for_key_system);
218 #endif 219 #endif
219 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, 220 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins,
220 pepper_plugin); 221 pepper_plugin);
221 } 222 }
222 223
223 void LoadTestPage() { 224 void LoadTestPage() {
224 // Load the test page needed. IsConcreteSupportedKeySystem() needs some 225 // Load the test page needed. IsConcreteSupportedKeySystem() needs some
225 // JavaScript and a video loaded in order to work. 226 // JavaScript and a video loaded in order to work.
226 if (!is_test_page_loaded_) { 227 if (!is_test_page_loaded_) {
227 ASSERT_TRUE(test_server()->Start()); 228 net::SpawnedTestServer http_test_server(
228 GURL gurl = test_server()->GetURL( 229 net::SpawnedTestServer::TYPE_HTTP,
229 "files/media/test_key_system_instantiation.html"); 230 net::SpawnedTestServer::kLocalhost,
231 media::GetTestDataPath());
232 ASSERT_TRUE(http_test_server.Start());
233 GURL gurl = http_test_server.GetURL(
234 "files/test_key_system_instantiation.html");
230 ui_test_utils::NavigateToURL(browser(), gurl); 235 ui_test_utils::NavigateToURL(browser(), gurl);
231 is_test_page_loaded_ = true; 236 is_test_page_loaded_ = true;
232 } 237 }
233 } 238 }
234 239
235 bool IsConcreteSupportedKeySystem(const std::string& key) { 240 bool IsConcreteSupportedKeySystem(const std::string& key) {
236 std::string command( 241 std::string command(
237 "window.domAutomationController.send(testKeySystemInstantiation('"); 242 "window.domAutomationController.send(testKeySystemInstantiation('");
238 command.append(key); 243 command.append(key);
239 command.append("'));"); 244 command.append("'));");
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 EncryptedMediaIsTypeSupportedWidevineCDMRegisteredWithWrongPathTest, 1136 EncryptedMediaIsTypeSupportedWidevineCDMRegisteredWithWrongPathTest,
1132 PepperCDMsRegisteredButAdapterNotPresent) { 1137 PepperCDMsRegisteredButAdapterNotPresent) {
1133 EXPECT_FALSE(IsConcreteSupportedKeySystem(kWidevineAlpha)); 1138 EXPECT_FALSE(IsConcreteSupportedKeySystem(kWidevineAlpha));
1134 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 1139 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
1135 "video/webm", no_codecs(), kWidevineAlpha)); 1140 "video/webm", no_codecs(), kWidevineAlpha));
1136 } 1141 }
1137 #endif // !defined(WIDEVINE_CDM_AVAILABLE) || defined(WIDEVINE_CDM_IS_COMPONENT ) 1142 #endif // !defined(WIDEVINE_CDM_AVAILABLE) || defined(WIDEVINE_CDM_IS_COMPONENT )
1138 #endif // defined(ENABLE_PEPPER_CDMS) 1143 #endif // defined(ENABLE_PEPPER_CDMS)
1139 1144
1140 } // namespace chrome 1145 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698