diff --git a/chrome/browser/media/encrypted_media_browsertest.cc b/chrome/browser/media/encrypted_media_browsertest.cc
index 40a73b4..65a7280 100644
--- a/chrome/browser/media/encrypted_media_browsertest.cc
+++ b/chrome/browser/media/encrypted_media_browsertest.cc
@@ -115,12 +115,14 @@
   }
 #endif  // defined(WIDEVINE_CDM_AVAILABLE)
 
-  void RunEncryptedMediaTestPage(const std::string& html_page,
-                                 const std::string& key_system,
-                                 std::vector<StringPair>* query_params,
-                                 const std::string& expected_title) {
-    StartLicenseServerIfNeeded(key_system, query_params);
-    RunMediaTestPage(html_page, query_params, expected_title, true);
+  void RunEncryptedMediaTestPage(
+      const std::string& html_page,
+      const std::string& key_system,
+      const media::QueryParams& query_params,
+      const std::string& expected_title) {
+    media::QueryParams new_query_params = query_params;
+    StartLicenseServerIfNeeded(key_system, &new_query_params);
+    RunMediaTestPage(html_page, new_query_params, expected_title, true);
   }
 
   // Tests |html_page| using |media_file| (with |media_type|) and |key_system|.
@@ -144,7 +146,7 @@
       VLOG(0) << "Skipping test - MSE not supported.";
       return;
     }
-    std::vector<StringPair> query_params;
+    media::QueryParams query_params;
     query_params.push_back(std::make_pair("mediaFile", media_file));
     query_params.push_back(std::make_pair("mediaType", media_type));
     query_params.push_back(std::make_pair("keySystem", key_system));
@@ -156,7 +158,7 @@
       query_params.push_back(std::make_pair("forceInvalidResponse", "1"));
     if (!session_to_load.empty())
       query_params.push_back(std::make_pair("sessionToLoad", session_to_load));
-    RunEncryptedMediaTestPage(html_page, key_system, &query_params,
+    RunEncryptedMediaTestPage(html_page, key_system, query_params,
                               expected_title);
   }
 
@@ -188,16 +190,17 @@
     EXPECT_TRUE(receivedKeyMessage);
   }
 
-
+  // Starts a license server if available for the |key_system| and adds a
+  // 'licenseServerURL' query parameter to |query_params|.
   void StartLicenseServerIfNeeded(const std::string& key_system,
-                                  std::vector<StringPair>* query_params) {
+                                  media::QueryParams* query_params) {
     scoped_ptr<TestLicenseServerConfig> config = GetServerConfig(key_system);
     if (!config)
       return;
     license_server_.reset(new TestLicenseServer(config.Pass()));
     EXPECT_TRUE(license_server_->Start());
-    query_params->push_back(std::make_pair("licenseServerURL",
-        license_server_->GetServerURL()));
+    query_params->push_back(
+        std::make_pair("licenseServerURL", license_server_->GetServerURL()));
   }
 
   bool IsPlayBackPossible(const std::string& key_system) {
@@ -312,7 +315,7 @@
     // Since we do not test playback, arbitrarily choose a test file and source
     // type.
     RunEncryptedMediaTest(kDefaultEmePlayer,
-                          "bear-a-enc_a.webm",
+                          "bear-a_enc-a.webm",
                           kWebMAudioOnly,
                           key_system,
                           SRC,
@@ -379,7 +382,7 @@
 
   void RunInvalidResponseTest() {
     RunEncryptedMediaTest(kDefaultEmePlayer,
-                          "bear-320x240-av-enc_av.webm",
+                          "bear-320x240-av_enc-av.webm",
                           kWebMAudioVideo,
                           CurrentKeySystem(),
                           CurrentSourceType(),
@@ -391,7 +394,7 @@
 
   void TestFrameSizeChange() {
     RunEncryptedMediaTest("encrypted_frame_size_change.html",
-                          "frame_size_change-av-enc-v.webm",
+                          "frame_size_change-av_enc-v.webm",
                           kWebMAudioVideo,
                           CurrentKeySystem(),
                           CurrentSourceType(),
@@ -403,14 +406,14 @@
 
   void TestConfigChange() {
     DCHECK(IsMSESupported());
-    std::vector<StringPair> query_params;
+    media::QueryParams query_params;
     query_params.push_back(std::make_pair("keySystem", CurrentKeySystem()));
     query_params.push_back(std::make_pair("runEncrypted", "1"));
     if (CurrentEmeVersion() == PREFIXED)
       query_params.push_back(std::make_pair("usePrefixedEME", "1"));
     RunEncryptedMediaTestPage("mse_config_change.html",
                               CurrentKeySystem(),
-                              &query_params,
+                              query_params,
                               kEnded);
   }
 
@@ -488,7 +491,7 @@
                         Combine(Values(kExternalClearKeyDecryptOnlyKeySystem),
                                 Values(MSE),
                                 Values(UNPREFIXED)));
-#endif // defined(ENABLE_PEPPER_CDMS)
+#endif  // defined(ENABLE_PEPPER_CDMS)
 
 #if defined(WIDEVINE_CDM_AVAILABLE)
 // This test doesn't fully test playback with Widevine. So we only run Widevine
@@ -511,27 +514,27 @@
 #endif  // defined(WIDEVINE_CDM_AVAILABLE)
 
 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM) {
-  TestSimplePlayback("bear-a-enc_a.webm", kWebMAudioOnly);
+  TestSimplePlayback("bear-a_enc-a.webm", kWebMAudioOnly);
 }
 
 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) {
-  TestSimplePlayback("bear-320x240-av-enc_a.webm", kWebMAudioVideo);
+  TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMAudioVideo);
 }
 
 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoAudio_WebM) {
-  TestSimplePlayback("bear-320x240-av-enc_av.webm", kWebMAudioVideo);
+  TestSimplePlayback("bear-320x240-av_enc-av.webm", kWebMAudioVideo);
 }
 
 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM) {
-  TestSimplePlayback("bear-320x240-v-enc_v.webm", kWebMVideoOnly);
+  TestSimplePlayback("bear-320x240-v_enc-v.webm", kWebMVideoOnly);
 }
 
 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoClearAudio_WebM) {
-  TestSimplePlayback("bear-320x240-av-enc_v.webm", kWebMAudioVideo);
+  TestSimplePlayback("bear-320x240-av_enc-v.webm", kWebMAudioVideo);
 }
 
 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VP9Video_WebM) {
-  TestSimplePlayback("bear-320x240-v-vp9-enc_v.webm", kWebMVP9VideoOnly);
+  TestSimplePlayback("bear-320x240-v-vp9_enc-v.webm", kWebMVP9VideoOnly);
 }
 
 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, InvalidResponseKeyError) {
@@ -587,7 +590,7 @@
 // The parent key system cannot be used in generateKeyRequest.
 IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest, ParentThrowsException_Prefixed) {
   RunEncryptedMediaTest(kDefaultEmePlayer,
-                        "bear-a-enc_a.webm",
+                        "bear-a_enc-a.webm",
                         kWebMAudioOnly,
                         "com.widevine",
                         MSE,
@@ -601,7 +604,7 @@
 // The parent key system cannot be used when creating MediaKeys.
 IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest, ParentThrowsException) {
   RunEncryptedMediaTest(kDefaultEmePlayer,
-                        "bear-a-enc_a.webm",
+                        "bear-a_enc-a.webm",
                         kWebMAudioOnly,
                         "com.widevine",
                         MSE,
@@ -640,7 +643,7 @@
 
 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadLoadableSession) {
   RunEncryptedMediaTest(kDefaultEmePlayer,
-                        "bear-320x240-v-enc_v.webm",
+                        "bear-320x240-v_enc-v.webm",
                         kWebMVideoOnly,
                         kExternalClearKeyKeySystem,
                         SRC,
@@ -653,7 +656,7 @@
 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadUnknownSession) {
   // TODO(xhwang): Add a specific error for this failure, e.g. kSessionNotFound.
   RunEncryptedMediaTest(kDefaultEmePlayer,
-                        "bear-320x240-v-enc_v.webm",
+                        "bear-320x240-v_enc-v.webm",
                         kWebMVideoOnly,
                         kExternalClearKeyKeySystem,
                         SRC,
diff --git a/chrome/browser/media/encrypted_media_istypesupported_browsertest.cc b/chrome/browser/media/encrypted_media_istypesupported_browsertest.cc
index 4ffde6f..3e7dc6c 100644
--- a/chrome/browser/media/encrypted_media_istypesupported_browsertest.cc
+++ b/chrome/browser/media/encrypted_media_istypesupported_browsertest.cc
@@ -17,6 +17,7 @@
 #include "chrome/test/base/ui_test_utils.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/test/browser_test_utils.h"
+#include "media/base/test_data_util.h"
 #include "url/gurl.h"
 
 #include "widevine_cdm_version.h"  // In SHARED_INTERMEDIATE_DIR.
@@ -224,9 +225,10 @@
     // Load the test page needed. IsConcreteSupportedKeySystem() needs some
     // JavaScript and a video loaded in order to work.
     if (!is_test_page_loaded_) {
-      ASSERT_TRUE(test_server()->Start());
-      GURL gurl = test_server()->GetURL(
-          "files/media/test_key_system_instantiation.html");
+      scoped_ptr<net::SpawnedTestServer> http_test_server =
+          media::StartMediaHttpTestServer();
+      GURL gurl = http_test_server->GetURL(
+          "files/test_key_system_instantiation.html");
       ui_test_utils::NavigateToURL(browser(), gurl);
       is_test_page_loaded_ = true;
     }
diff --git a/chrome/browser/media/media_browsertest.cc b/chrome/browser/media/media_browsertest.cc
index cf0195e..aca81db 100644
--- a/chrome/browser/media/media_browsertest.cc
+++ b/chrome/browser/media/media_browsertest.cc
@@ -4,12 +4,9 @@
 
 #include "chrome/browser/media/media_browsertest.h"
 
-#include "base/path_service.h"
-#include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "chrome/browser/ui/browser.h"
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "chrome/common/chrome_paths.h"
 #include "chrome/test/base/ui_test_utils.h"
 #include "content/public/browser/navigation_controller.h"
 #include "content/public/browser/navigation_entry.h"
@@ -28,37 +25,27 @@
 MediaBrowserTest::~MediaBrowserTest() {
 }
 
-void MediaBrowserTest::RunMediaTestPage(
-    const std::string& html_page, std::vector<StringPair>* query_params,
-    const std::string& expected_title, bool http) {
+void MediaBrowserTest::RunMediaTestPage(const std::string& html_page,
+                                        const media::QueryParams& query_params,
+                                        const std::string& expected_title,
+                                        bool http) {
   GURL gurl;
-  std::string query = "";
-  if (query_params != NULL && !query_params->empty()) {
-    std::vector<StringPair>::const_iterator itr = query_params->begin();
-    query = itr->first + "=" + itr->second;
-    ++itr;
-    for (; itr != query_params->end(); ++itr) {
-      query.append("&" + itr->first + "=" + itr->second);
-    }
-  }
+  std::string query = media::GetURLQueryString(query_params);
+  scoped_ptr<net::SpawnedTestServer> http_test_server;
   if (http) {
-    ASSERT_TRUE(test_server()->Start());
-    gurl = test_server()->GetURL("files/media/" + html_page + "?" + query);
+    http_test_server = media::StartMediaHttpTestServer();
+    gurl = http_test_server->GetURL("files/" + html_page + "?" + query);
   } else {
-    base::FilePath test_file_path;
-    PathService::Get(chrome::DIR_TEST_DATA, &test_file_path);
-    test_file_path = test_file_path.AppendASCII("media")
-                                   .AppendASCII(html_page);
-    gurl = content::GetFileUrlWithQuery(test_file_path, query);
+    gurl = content::GetFileUrlWithQuery(media::GetTestDataFilePath(html_page),
+                                        query);
   }
-
-  base::string16 final_title = RunTest(gurl, expected_title);
-  EXPECT_EQ(base::ASCIIToUTF16(expected_title), final_title);
+  std::string final_title = RunTest(gurl, expected_title);
+  EXPECT_EQ(expected_title, final_title);
 }
 
-base::string16 MediaBrowserTest::RunTest(const GURL& gurl,
-                                         const std::string& expected_title) {
-  VLOG(0) << "Running test URL: " << gurl;
+std::string MediaBrowserTest::RunTest(const GURL& gurl,
+                                      const std::string& expected_title) {
+  DVLOG(0) << "Running test URL: " << gurl;
   // Observe the web contents for plugin crashes.
   Observe(browser()->tab_strip_model()->GetActiveWebContents());
   content::TitleWatcher title_watcher(
@@ -66,8 +53,8 @@
       base::ASCIIToUTF16(expected_title));
   AddWaitForTitles(&title_watcher);
   ui_test_utils::NavigateToURL(browser(), gurl);
-
-  return title_watcher.WaitAndGetTitle();
+  base::string16 result = title_watcher.WaitAndGetTitle();
+  return base::UTF16ToASCII(result);
 }
 
 void MediaBrowserTest::AddWaitForTitles(content::TitleWatcher* title_watcher) {
diff --git a/chrome/browser/media/media_browsertest.h b/chrome/browser/media/media_browsertest.h
index be62f7a..893fab1 100644
--- a/chrome/browser/media/media_browsertest.h
+++ b/chrome/browser/media/media_browsertest.h
@@ -5,11 +5,11 @@
 #ifndef CHROME_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_
 #define CHROME_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_
 
-#include <utility>
-#include <vector>
+#include <string>
 
 #include "chrome/test/base/in_process_browser_test.h"
 #include "content/public/browser/web_contents_observer.h"
+#include "media/base/test_data_util.h"
 
 namespace content {
 class TitleWatcher;
@@ -21,8 +21,6 @@
 class MediaBrowserTest : public InProcessBrowserTest,
                          public content::WebContentsObserver {
  protected:
-  typedef std::pair<std::string, std::string> StringPair;
-
   // Common test results.
   static const char kEnded[];
   // TODO(xhwang): Report detailed errors, e.g. "ERROR-3".
@@ -38,12 +36,13 @@
   // page, otherwise a local file URL is loaded inside the content shell.
   // It uses RunTest() to check for expected test output.
   void RunMediaTestPage(const std::string& html_page,
-                        std::vector<StringPair>* query_params,
-                        const std::string& expected, bool http);
+                        const media::QueryParams& query_params,
+                        const std::string& expected,
+                        bool http);
 
   // Opens a URL and waits for the document title to match either one of the
-  // default strings or the expected string.
-  base::string16 RunTest(const GURL& gurl, const std::string& expected);
+  // default strings or the expected string. Returns the matching title value.
+  std::string RunTest(const GURL& gurl, const std::string& expected);
 
   virtual void AddWaitForTitles(content::TitleWatcher* title_watcher);
 
diff --git a/chrome/test/data/media/eme_player_js/test_config.js b/chrome/test/data/media/eme_player_js/test_config.js
deleted file mode 100644
index e654a1c..0000000
--- a/chrome/test/data/media/eme_player_js/test_config.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Test configuration used by test page to configure the player app and other
-// test specific configurations.
-function TestConfig() {
-  this.mediaFile = null;
-  this.keySystem = null;
-  this.mediaType = null;
-  this.licenseServerURL = null;
-  this.useMSE = false;
-  this.usePrefixedEME = false;
-  this.runFPS = false;
-}
-
-TestConfig.prototype.loadQueryParams = function() {
-  // Load query parameters and set default values.
-  var r = /([^&=]+)=?([^&]*)/g;
-  // Lambda function for decoding extracted match values. Replaces '+' with
-  // space so decodeURIComponent functions properly.
-  var decodeURI = function decodeURI(s) {
-      return decodeURIComponent(s.replace(/\+/g, ' '));
-  };
-  var match;
-  while (match = r.exec(window.location.search.substring(1)))
-    this[decodeURI(match[1])] = decodeURI(match[2]);
-  this.useMSE = this.useMSE == '1' || this.useMSE == 'true';
-  this.usePrefixedEME =
-      this.usePrefixedEME == '1' || this.usePrefixedEME == 'true';
-};
diff --git a/chrome/test/data/media/frame_size_change-av-enc-v.webm b/chrome/test/data/media/frame_size_change-av-enc-v.webm
deleted file mode 100644
index 200be55..0000000
--- a/chrome/test/data/media/frame_size_change-av-enc-v.webm
+++ /dev/null
Binary files differ
diff --git a/content/browser/media/encrypted_media_browsertest.cc b/content/browser/media/encrypted_media_browsertest.cc
index 9c0dbac..9f5e137 100644
--- a/content/browser/media/encrypted_media_browsertest.cc
+++ b/content/browser/media/encrypted_media_browsertest.cc
@@ -3,7 +3,6 @@
 // found in the LICENSE file.
 
 #include "base/command_line.h"
-#include "base/path_service.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/win/windows_version.h"
 #include "content/browser/media/media_browsertest.h"
@@ -26,6 +25,8 @@
 const char kEmeKeyError[] = "KEYERROR";
 const char kEmeNotSupportedError[] = "NOTSUPPORTEDERROR";
 
+const char kDefaultEmePlayer[] = "eme_player.html";
+
 // The type of video src used to load media.
 enum SrcType {
   SRC,
@@ -52,7 +53,7 @@
     public testing::WithParamInterface<std::tr1::tuple<const char*, SrcType> > {
  public:
   // Can only be used in parameterized (*_P) tests.
-  const char* CurrentKeySystem() {
+  const std::string CurrentKeySystem() {
     return std::tr1::get<0>(GetParam());
   }
 
@@ -61,14 +62,15 @@
     return std::tr1::get<1>(GetParam());
   }
 
-  void TestSimplePlayback(const char* encrypted_media, const char* media_type) {
+  void TestSimplePlayback(const std::string& encrypted_media,
+                          const std::string& media_type) {
     RunSimpleEncryptedMediaTest(
         encrypted_media, media_type, CurrentKeySystem(), CurrentSourceType());
   }
 
   void TestFrameSizeChange() {
     RunEncryptedMediaTest("encrypted_frame_size_change.html",
-                          "frame_size_change-av-enc-v.webm", kWebMAudioVideo,
+                          "frame_size_change-av_enc-v.webm", kWebMAudioVideo,
                           CurrentKeySystem(), CurrentSourceType(), kEnded);
   }
 
@@ -78,38 +80,42 @@
       return;
     }
 
-    std::vector<StringPair> query_params;
-    query_params.push_back(std::make_pair("keysystem", CurrentKeySystem()));
-    query_params.push_back(std::make_pair("runencrypted", "1"));
-    RunMediaTestPage("mse_config_change.html", &query_params, kEnded, true);
+    media::QueryParams query_params;
+    query_params.push_back(std::make_pair("keySystem", CurrentKeySystem()));
+    query_params.push_back(std::make_pair("runEncrypted", "1"));
+    RunMediaTestPage("mse_config_change.html", query_params, kEnded, true);
   }
 
-  void RunEncryptedMediaTest(const char* html_page,
-                             const char* media_file,
-                             const char* media_type,
-                             const char* key_system,
+  void RunEncryptedMediaTest(const std::string& html_page,
+                             const std::string& media_file,
+                             const std::string& media_type,
+                             const std::string& key_system,
                              SrcType src_type,
-                             const char* expectation) {
+                             const std::string& expectation) {
     if (src_type == MSE && !IsMSESupported()) {
       VLOG(0) << "Skipping test - MSE not supported.";
       return;
     }
 
-    std::vector<StringPair> query_params;
-    query_params.push_back(std::make_pair("mediafile", media_file));
-    query_params.push_back(std::make_pair("mediatype", media_type));
-    query_params.push_back(std::make_pair("keysystem", key_system));
+    media::QueryParams query_params;
+    query_params.push_back(std::make_pair("mediaFile", media_file));
+    query_params.push_back(std::make_pair("mediaType", media_type));
+    query_params.push_back(std::make_pair("keySystem", key_system));
     if (src_type == MSE)
-      query_params.push_back(std::make_pair("usemse", "1"));
-    RunMediaTestPage(html_page, &query_params, expectation, true);
+      query_params.push_back(std::make_pair("useMSE", "1"));
+    RunMediaTestPage(html_page, query_params, expectation, true);
   }
 
-  void RunSimpleEncryptedMediaTest(const char* media_file,
-                                   const char* media_type,
-                                   const char* key_system,
+  void RunSimpleEncryptedMediaTest(const std::string& media_file,
+                                   const std::string& media_type,
+                                   const std::string& key_system,
                                    SrcType src_type) {
-    RunEncryptedMediaTest("encrypted_media_player.html", media_file,
-                          media_type, key_system, src_type, kEnded);
+    RunEncryptedMediaTest(kDefaultEmePlayer,
+                          media_file,
+                          media_type,
+                          key_system,
+                          src_type,
+                          kEnded);
   }
 
  protected:
@@ -141,23 +147,23 @@
                         Combine(Values(kClearKeyKeySystem), Values(MSE)));
 
 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM) {
-  TestSimplePlayback("bear-a-enc_a.webm", kWebMAudioOnly);
+  TestSimplePlayback("bear-a_enc-a.webm", kWebMAudioOnly);
 }
 
 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) {
-  TestSimplePlayback("bear-320x240-av-enc_a.webm", kWebMAudioVideo);
+  TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMAudioVideo);
 }
 
 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoAudio_WebM) {
-  TestSimplePlayback("bear-320x240-av-enc_av.webm", kWebMAudioVideo);
+  TestSimplePlayback("bear-320x240-av_enc-av.webm", kWebMAudioVideo);
 }
 
 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM) {
-  TestSimplePlayback("bear-320x240-v-enc_v.webm", kWebMVideoOnly);
+  TestSimplePlayback("bear-320x240-v_enc-v.webm", kWebMVideoOnly);
 }
 
 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoClearAudio_WebM) {
-  TestSimplePlayback("bear-320x240-av-enc_v.webm", kWebMAudioVideo);
+  TestSimplePlayback("bear-320x240-av_enc-v.webm", kWebMAudioVideo);
 }
 
 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, ConfigChangeVideo) {
@@ -174,8 +180,11 @@
 }
 
 IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) {
-  RunEncryptedMediaTest("encrypted_media_player.html", "bear-a-enc_a.webm",
-                        kWebMAudioOnly, "com.example.foo", MSE,
+  RunEncryptedMediaTest(kDefaultEmePlayer,
+                        "bear-a_enc-a.webm",
+                        kWebMAudioOnly,
+                        "com.example.foo",
+                        MSE,
                         kEmeNotSupportedError);
 }
 
diff --git a/content/browser/media/media_browsertest.cc b/content/browser/media/media_browsertest.cc
index a0658c2..4535880 100644
--- a/content/browser/media/media_browsertest.cc
+++ b/content/browser/media/media_browsertest.cc
@@ -4,10 +4,8 @@
 
 #include "content/browser/media/media_browsertest.h"
 
-#include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "content/public/browser/web_contents.h"
-#include "content/public/common/url_constants.h"
 #include "content/public/test/browser_test_utils.h"
 #include "content/public/test/content_browser_test_utils.h"
 #include "content/shell/browser/shell.h"
@@ -26,39 +24,33 @@
 const char MediaBrowserTest::kError[] = "ERROR";
 const char MediaBrowserTest::kFailed[] = "FAILED";
 
-void MediaBrowserTest::RunMediaTestPage(
-    const char* html_page, std::vector<StringPair>* query_params,
-    const char* expected, bool http) {
+void MediaBrowserTest::RunMediaTestPage(const std::string& html_page,
+                                        const media::QueryParams& query_params,
+                                        const std::string& expected_title,
+                                        bool http) {
   GURL gurl;
-  std::string query = "";
-  if (query_params != NULL && !query_params->empty()) {
-    std::vector<StringPair>::const_iterator itr = query_params->begin();
-    query = base::StringPrintf("%s=%s", itr->first, itr->second);
-    ++itr;
-    for (; itr != query_params->end(); ++itr) {
-      query.append(base::StringPrintf("&%s=%s", itr->first, itr->second));
-    }
-  }
+  std::string query = media::GetURLQueryString(query_params);
+  scoped_ptr<net::SpawnedTestServer> http_test_server;
   if (http) {
-    ASSERT_TRUE(test_server()->Start());
-    gurl = test_server()->GetURL(
-        base::StringPrintf("files/media/%s?%s", html_page, query.c_str()));
+    http_test_server = media::StartMediaHttpTestServer();
+    gurl = http_test_server->GetURL("files/" + html_page + "?" + query);
   } else {
-    base::FilePath test_file_path = GetTestFilePath("media", html_page);
-    gurl = GetFileUrlWithQuery(test_file_path, query);
+    gurl = content::GetFileUrlWithQuery(media::GetTestDataFilePath(html_page),
+                                        query);
   }
-  RunTest(gurl, expected);
+  std::string final_title = RunTest(gurl, expected_title);
+  EXPECT_EQ(expected_title, final_title);
 }
 
-void MediaBrowserTest::RunTest(const GURL& gurl, const char* expected) {
-  const base::string16 expected_title = base::ASCIIToUTF16(expected);
-  DVLOG(1) << "Running test URL: " << gurl;
-  TitleWatcher title_watcher(shell()->web_contents(), expected_title);
+std::string MediaBrowserTest::RunTest(const GURL& gurl,
+                                      const std::string& expected_title) {
+  VLOG(0) << "Running test URL: " << gurl;
+  TitleWatcher title_watcher(shell()->web_contents(),
+                             base::ASCIIToUTF16(expected_title));
   AddWaitForTitles(&title_watcher);
   NavigateToURL(shell(), gurl);
-
-  base::string16 final_title = title_watcher.WaitAndGetTitle();
-  EXPECT_EQ(expected_title, final_title);
+  base::string16 result = title_watcher.WaitAndGetTitle();
+  return base::UTF16ToASCII(result);
 }
 
 void MediaBrowserTest::AddWaitForTitles(content::TitleWatcher* title_watcher) {
@@ -75,25 +67,29 @@
                   public MediaBrowserTest {
  public:
   // Play specified audio over http:// or file:// depending on |http| setting.
-  void PlayAudio(const char* media_file, bool http) {
+  void PlayAudio(const std::string& media_file, bool http) {
     PlayMedia("audio", media_file, http);
   }
 
   // Play specified video over http:// or file:// depending on |http| setting.
-  void PlayVideo(const char* media_file, bool http) {
+  void PlayVideo(const std::string& media_file, bool http) {
     PlayMedia("video", media_file, http);
   }
 
   // Run specified color format test with the expected result.
-  void RunColorFormatTest(const char* media_file, const char* expected) {
-    base::FilePath test_file_path = GetTestFilePath("media", "blackwhite.html");
+  void RunColorFormatTest(const std::string& media_file,
+                          const std::string& expected) {
+    base::FilePath test_file_path =
+        media::GetTestDataFilePath("blackwhite.html");
     RunTest(GetFileUrlWithQuery(test_file_path, media_file), expected);
   }
 
-  void PlayMedia(const char* tag, const char* media_file, bool http) {
-    std::vector<StringPair> query_params;
+  void PlayMedia(const std::string& tag,
+                 const std::string& media_file,
+                 bool http) {
+    media::QueryParams query_params;
     query_params.push_back(std::make_pair(tag, media_file));
-    RunMediaTestPage("player.html", &query_params, kEnded, http);
+    RunMediaTestPage("player.html", query_params, kEnded, http);
   }
 };
 
@@ -140,7 +136,7 @@
 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearMovPcmS24be) {
   PlayVideo("bear_pcm_s24be.mov", GetParam());
 }
-#endif
+#endif  // defined(USE_PROPRIETARY_CODECS)
 
 #if defined(OS_CHROMEOS)
 #if defined(USE_PROPRIETARY_CODECS)
@@ -171,8 +167,9 @@
 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearFlac) {
   PlayAudio("bear.flac", GetParam());
 }
-#endif
-#endif
+#endif  // defined(USE_PROPRIETARY_CODECS)
+#endif  // defined(OS_CHROMEOS)
+
 
 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearWavAlaw) {
   PlayAudio("bear_alaw.wav", GetParam());
@@ -209,19 +206,19 @@
 INSTANTIATE_TEST_CASE_P(Http, MediaTest, ::testing::Values(true));
 
 IN_PROC_BROWSER_TEST_F(MediaTest, MAYBE(Yuv420pTheora)) {
-  RunColorFormatTest("yuv420p.ogv", "ENDED");
+  RunColorFormatTest("yuv420p.ogv", kEnded);
 }
 
 IN_PROC_BROWSER_TEST_F(MediaTest, MAYBE(Yuv422pTheora)) {
-  RunColorFormatTest("yuv422p.ogv", "ENDED");
+  RunColorFormatTest("yuv422p.ogv", kEnded);
 }
 
 IN_PROC_BROWSER_TEST_F(MediaTest, MAYBE(Yuv444pTheora)) {
-  RunColorFormatTest("yuv444p.ogv", "ENDED");
+  RunColorFormatTest("yuv444p.ogv", kEnded);
 }
 
 IN_PROC_BROWSER_TEST_F(MediaTest, MAYBE(Yuv420pVp8)) {
-  RunColorFormatTest("yuv420p.webm", "ENDED");
+  RunColorFormatTest("yuv420p.webm", kEnded);
 }
 
 // TODO(johannkoenig): Reenable after landing libvpx roll
@@ -232,24 +229,24 @@
 
 #if defined(USE_PROPRIETARY_CODECS)
 IN_PROC_BROWSER_TEST_F(MediaTest, MAYBE(Yuv420pH264)) {
-  RunColorFormatTest("yuv420p.mp4", "ENDED");
+  RunColorFormatTest("yuv420p.mp4", kEnded);
 }
 
 IN_PROC_BROWSER_TEST_F(MediaTest, MAYBE(Yuvj420pH264)) {
-  RunColorFormatTest("yuvj420p.mp4", "ENDED");
+  RunColorFormatTest("yuvj420p.mp4", kEnded);
 }
 
 IN_PROC_BROWSER_TEST_F(MediaTest, MAYBE(Yuv422pH264)) {
-  RunColorFormatTest("yuv422p.mp4", "ENDED");
+  RunColorFormatTest("yuv422p.mp4", kEnded);
 }
 
 IN_PROC_BROWSER_TEST_F(MediaTest, MAYBE(Yuv444pH264)) {
-  RunColorFormatTest("yuv444p.mp4", "ENDED");
+  RunColorFormatTest("yuv444p.mp4", kEnded);
 }
 
 #if defined(OS_CHROMEOS)
 IN_PROC_BROWSER_TEST_F(MediaTest, Yuv420pMpeg4) {
-  RunColorFormatTest("yuv420p.avi", "ENDED");
+  RunColorFormatTest("yuv420p.avi", kEnded);
 }
 #endif  // defined(OS_CHROMEOS)
 #endif  // defined(USE_PROPRIETARY_CODECS)
diff --git a/content/browser/media/media_browsertest.h b/content/browser/media/media_browsertest.h
index b242db3..4be3197 100644
--- a/content/browser/media/media_browsertest.h
+++ b/content/browser/media/media_browsertest.h
@@ -5,10 +5,10 @@
 #ifndef CONTENT_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_
 #define CONTENT_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_
 
-#include <utility>
-#include <vector>
+#include <string>
 
 #include "content/public/test/content_browser_test.h"
+#include "media/base/test_data_util.h"
 
 namespace content {
 
@@ -19,8 +19,6 @@
 // the test http server.
 class MediaBrowserTest : public ContentBrowserTest {
  public:
-  typedef std::pair<const char*, const char*> StringPair;
-
   // Common test results.
   static const char kEnded[];
   static const char kError[];
@@ -30,17 +28,18 @@
   // If http is true, the test starts a local http test server to load the test
   // page, otherwise a local file URL is loaded inside the content shell.
   // It uses RunTest() to check for expected test output.
-  void RunMediaTestPage(const char* html_page,
-                        std::vector<StringPair>* query_params,
-                        const char* expected, bool http);
+  void RunMediaTestPage(const std::string& html_page,
+                        const media::QueryParams& query_params,
+                        const std::string& expected,
+                        bool http);
 
   // Opens a URL and waits for the document title to match either one of the
-  // default strings or the expected string.
-  void RunTest(const GURL& gurl, const char* expected);
+  // default strings or the expected string. Returns the matching title value.
+  std::string RunTest(const GURL& gurl, const std::string& expected);
 
   virtual void AddWaitForTitles(content::TitleWatcher* title_watcher);
 };
 
-} // namespace content
+}  // namespace content
 
 #endif  // CONTENT_BROWSER_MEDIA_MEDIA_BROWSERTEST_H_
diff --git a/content/browser/media/media_source_browsertest.cc b/content/browser/media/media_source_browsertest.cc
index d5d8615..90d0c84 100644
--- a/content/browser/media/media_source_browsertest.cc
+++ b/content/browser/media/media_source_browsertest.cc
@@ -32,17 +32,18 @@
 
 class MediaSourceTest : public content::MediaBrowserTest {
  public:
-  void TestSimplePlayback(const char* media_file, const char* media_type,
-                          const char* expectation) {
+  void TestSimplePlayback(const std::string& media_file,
+                          const std::string& media_type,
+                          const std::string& expectation) {
     if (!IsMSESupported()) {
       VLOG(0) << "Skipping test - MSE not supported.";
       return;
     }
 
-    std::vector<StringPair> query_params;
-    query_params.push_back(std::make_pair("mediafile", media_file));
-    query_params.push_back(std::make_pair("mediatype", media_type));
-    RunMediaTestPage("media_source_player.html", &query_params, expectation,
+    media::QueryParams query_params;
+    query_params.push_back(std::make_pair("mediaFile", media_file));
+    query_params.push_back(std::make_pair("mediaType", media_type));
+    RunMediaTestPage("media_source_player.html", query_params, expectation,
                      true);
   }
 
@@ -84,7 +85,10 @@
     VLOG(0) << "Skipping test - MSE not supported.";
     return;
   }
-  RunMediaTestPage("mse_config_change.html", NULL, kEnded, true);
+  RunMediaTestPage("mse_config_change.html",
+                   media::QueryParams(),
+                   kEnded,
+                   true);
 }
 
 }  // namespace content
diff --git a/content/test/data/media/encrypted_frame_size_change.html b/content/test/data/media/encrypted_frame_size_change.html
deleted file mode 100644
index 719d8be..0000000
--- a/content/test/data/media/encrypted_frame_size_change.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <body onload="load()">
-    <p>Tests decoding and rendering encrypted video element that has a changing
-      resolution.</p>
-    <video width=320 controls></video>
-    <video controls></video>
-    <script src="media_utils.js" type="text/javascript"></script>
-    <script src="media_source_utils.js" type="text/javascript"></script>
-    <script src="encrypted_media_utils.js" type="text/javascript"></script>
-    <script>
-      var firstVideoSeek = false;
-      var video_fixed_size = document.getElementsByTagName("video")[0];
-      var video = document.getElementsByTagName("video")[1];
-
-      function load() {
-        loadVideo(video_fixed_size);
-        loadVideo(video);
-      }
-
-      function loadVideo(video) {
-        var mediaSource = loadEncryptedMediaFromURL(video);
-
-        video.addEventListener('playing', function() {
-          // Make sure the video plays for a bit.
-          video.addEventListener('timeupdate', function() {
-            if (video.currentTime > 1.0) {
-              video.pause();
-            }
-          });
-        });
-
-        video.addEventListener('pause', function() {
-          video.addEventListener('seeked', function() {
-            if (!firstVideoSeek) {
-              console.log('One video seeked.');
-              firstVideoSeek = true;
-              return;
-            }
-            setResultInTitle('ENDED');
-          });
-          video.currentTime = 0.5;
-        });
-
-        video.addEventListener('canplay', oncanplay);
-        video.play();
-      }
-    </script>
-  </body>
-</html>
diff --git a/content/test/data/media/encrypted_media_player.html b/content/test/data/media/encrypted_media_player.html
deleted file mode 100644
index 2b16d51..0000000
--- a/content/test/data/media/encrypted_media_player.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <title>Encrypted Media Player</title>
-  </head>
-  <body onload="runTest();">
-    <video controls></video>
-    <script src="media_utils.js" type="text/javascript"></script>
-    <script src="media_source_utils.js" type="text/javascript"></script>
-    <script src="encrypted_media_utils.js" type="text/javascript"></script>
-    <script type="text/javascript">
-      var video = document.querySelector('video');
-
-      function onTimeUpdate() {
-        if (video.currentTime < 1)
-          return;
-        // keyadded may be fired around the start of playback; check for it
-        // after a delay to avoid timing issues.
-        if (!video.receivedKeyAdded)
-          failTest('Key added event not received.');
-        if (video.isHeartbeatExpected && !video.receivedHeartbeat)
-          failTest('Heartbeat keymessage event not received.');
-        video.removeEventListener('ended', failTest);
-        installTitleEventHandler(video, 'ended');
-        video.removeEventListener('timeupdate', onTimeUpdate);
-      }
-
-      // The test completes after playing the encrypted media for 1 second and
-      // getting the ended event or when an error occurs at any time.
-      function runTest() {
-        loadEncryptedMediaFromURL(video);
-        video.addEventListener('timeupdate', onTimeUpdate);
-        video.play();
-      }
-    </script>
-  </body>
-</html>
diff --git a/content/test/data/media/encrypted_media_utils.js b/content/test/data/media/encrypted_media_utils.js
deleted file mode 100644
index 8fb3f97..0000000
--- a/content/test/data/media/encrypted_media_utils.js
+++ /dev/null
@@ -1,142 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var keySystem = QueryString.keysystem;
-var mediaFile = QueryString.mediafile;
-var mediaType = QueryString.mediatype || 'video/webm; codecs="vorbis, vp8"';
-var useMSE = QueryString.usemse == 1;
-
-// Default key used to encrypt many media files used in browser tests.
-var KEY = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b,
-                          0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c]);
-// KEY_ID constant used as init data while encrypting test media files.
-var KEY_ID = getInitDataFromKeyId("0123456789012345");
-// Heart beat message header.
-var HEART_BEAT_HEADER = 'HEARTBEAT';
-var EXTERNAL_CLEAR_KEY_KEY_SYSTEM = "org.chromium.externalclearkey";
-// Note that his URL has been normalized from the one in clear_key_cdm.cc.
-var EXTERNAL_CLEAR_KEY_HEARTBEAT_URL =
-    'http://test.externalclearkey.chromium.org/';
-
-function isHeartbeatMessage(msg) {
-  if (msg.length < HEART_BEAT_HEADER.length)
-    return false;
-  for (var i = 0; i < HEART_BEAT_HEADER.length; ++i) {
-    if (String.fromCharCode(msg[i]) != HEART_BEAT_HEADER[i])
-      return false;
-  }
-  return true;
-}
-
-function loadEncryptedMediaFromURL(video) {
-  return loadEncryptedMedia(video, mediaFile, keySystem, KEY, useMSE);
-}
-
-function loadEncryptedMedia(video, mediaFile, keySystem, key, useMSE,
-                            appendSourceCallbackFn) {
-  var keyRequested = false;
-  var sourceOpened = false;
-  // Add properties to enable verification that events occurred.
-  video.receivedKeyAdded = false;
-  video.receivedHeartbeat = false;
-  video.isHeartbeatExpected = keySystem === EXTERNAL_CLEAR_KEY_KEY_SYSTEM;
-  video.receivedKeyMessage = false;
-
-  if (!(video && mediaFile && keySystem && key)) {
-    failTest('Missing parameters in loadEncryptedMedia().');
-    return;
-  }
-
-  function onNeedKey(e) {
-    if (keyRequested)
-      return;
-    keyRequested = true;
-    console.log('onNeedKey', e);
-    try {
-      video.webkitGenerateKeyRequest(keySystem, e.initData);
-    }
-    catch(error) {
-      setResultInTitle(error.name);
-    }
-  }
-
-  function onKeyAdded(e) {
-    e.target.receivedKeyAdded = true;
-  }
-
-  function onKeyMessage(e) {
-    video.receivedKeyMessage = true;
-    if (!e.keySystem || e.keySystem != keySystem) {
-      failTest('keymessage with unexpected keySystem: ' + e.keySystem);
-      return;
-    }
-
-    if (!e.sessionId) {
-      failTest('keymessage without a sessionId: ' + e.sessionId);
-      return;
-    }
-
-    if (!e.message) {
-      failTest('keymessage without a message: ' + e.message);
-      return;
-    }
-
-    if (isHeartbeatMessage(e.message)) {
-      console.log('onKeyMessage - heartbeat', e);
-      e.target.receivedHeartbeat = true;
-      verifyHeartbeatMessage(e);
-      return;
-    }
-
-    // No tested key system returns defaultURL in for key request messages.
-    if (e.defaultURL) {
-      failTest('keymessage unexpectedly has defaultURL: ' + e.defaultURL);
-      return;
-    }
-
-    // keymessage in response to generateKeyRequest. Reply with key.
-    console.log('onKeyMessage - key request', e);
-    var initData = e.message;
-    if (mediaType.indexOf('mp4') != -1)
-      initData = KEY_ID; // Temporary hack for Clear Key in v0.1.
-    video.webkitAddKey(keySystem, key, initData);
-  }
-
-  function verifyHeartbeatMessage(e) {
-    // Only External Clear Key sends a HEARTBEAT message.
-    if (e.keySystem != EXTERNAL_CLEAR_KEY_KEY_SYSTEM) {
-      failTest('Unexpected heartbeat from ' + e.keySystem);
-      return;
-    }
-
-    if (e.defaultURL != EXTERNAL_CLEAR_KEY_HEARTBEAT_URL) {
-      failTest('Heartbeat message with unexpected defaultURL: ' + e.defaultURL);
-      return;
-    }
-  }
-
-  video.addEventListener('webkitneedkey', onNeedKey);
-  video.addEventListener('webkitkeymessage', onKeyMessage);
-  video.addEventListener('webkitkeyerror', function() {
-      setResultInTitle("KeyError");
-  });
-  video.addEventListener('webkitkeyadded', onKeyAdded);
-  installTitleEventHandler(video, 'error');
-
-  if (useMSE) {
-    var mediaSource = loadMediaSource(mediaFile, mediaType,
-                                      appendSourceCallbackFn);
-    video.src = window.URL.createObjectURL(mediaSource);
-  } else {
-    video.src = mediaFile;
-  }
-}
-
-function getInitDataFromKeyId(keyID) {
-  var init_key_id = new Uint8Array(keyID.length);
-  for(var i = 0; i < keyID.length; i++) {
-    init_key_id[i] = keyID.charCodeAt(i);
-  }
-  return init_key_id;
-}
diff --git a/content/test/data/media/media_source_utils.js b/content/test/data/media/media_source_utils.js
deleted file mode 100644
index 7f179b5..0000000
--- a/content/test/data/media/media_source_utils.js
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-function loadMediaFromURL(video) {
-  installTitleEventHandler(video, 'error');
-  video.addEventListener('playing', function(event) {
-    console.log('Video Playing.');
-  });
-  var source = loadMediaSource(QueryString.mediafile, QueryString.mediatype);
-  video.src = window.URL.createObjectURL(source);
-}
-
-function loadMediaSource(mediaFiles, mediaTypes, appendSourceCallbackFn) {
-  mediaFiles = convertToArray(mediaFiles);
-  mediaTypes = convertToArray(mediaTypes);
-
-  if (!mediaFiles || !mediaTypes)
-    failTest('Missing parameters in loadMediaSource().');
-
-  var totalAppended = 0;
-  function onSourceOpen(e) {
-    console.log('onSourceOpen', e);
-    // We can load multiple media files using the same media type. However, if
-    // more than one media type is used, we expect to have a media type entry
-    // for each corresponding media file.
-    var srcBuffer = null;
-    for (var i = 0; i < mediaFiles.length; i++) {
-      if (i == 0 || mediaFiles.length == mediaTypes.length) {
-        console.log('Creating a source buffer for type ' + mediaTypes[i]);
-        try {
-          srcBuffer = mediaSource.addSourceBuffer(mediaTypes[i]);
-        } catch (e) {
-          failTest('Exception adding source buffer: ' + e.message);
-          return;
-        }
-      }
-      doAppend(mediaFiles[i], srcBuffer);
-    }
-  }
-
-  function doAppend(mediaFile, srcBuffer) {
-    var xhr = new XMLHttpRequest();
-    xhr.open('GET', mediaFile);
-    xhr.responseType = 'arraybuffer';
-    xhr.addEventListener('load', function(e) {
-      var onUpdateEnd = function(e) {
-        console.log('End of appending buffer from ' + mediaFile);
-        srcBuffer.removeEventListener('updateend', onUpdateEnd);
-        totalAppended++;
-        if (totalAppended == mediaFiles.length) {
-          if (appendSourceCallbackFn)
-            appendSourceCallbackFn(mediaSource);
-          else
-            mediaSource.endOfStream();
-        }
-      };
-      srcBuffer.addEventListener('updateend', onUpdateEnd);
-      srcBuffer.appendBuffer(new Uint8Array(e.target.response));
-    });
-    xhr.send();
-  }
-
-  var mediaSource = new MediaSource();
-  mediaSource.addEventListener('sourceopen', onSourceOpen);
-  return mediaSource;
-}
diff --git a/content/test/data/media/media_utils.js b/content/test/data/media/media_utils.js
deleted file mode 100644
index 8c5c1d6..0000000
--- a/content/test/data/media/media_utils.js
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var QueryString = function() {
-  // Allows access to query parameters on the URL; e.g., given a URL like:
-  //    http://<server>/my.html?test=123&bob=123
-  // Parameters can then be accessed via QueryString.test or QueryString.bob.
-  var params = {};
-  // RegEx to split out values by &.
-  var r = /([^&=]+)=?([^&]*)/g;
-  // Lambda function for decoding extracted match values. Replaces '+' with
-  // space so decodeURIComponent functions properly.
-  function d(s) { return decodeURIComponent(s.replace(/\+/g, ' ')); }
-  var match;
-  while (match = r.exec(window.location.search.substring(1)))
-    params[d(match[1])] = d(match[2]);
-  return params;
-}();
-
-function failTest(msg) {
-  var failMessage = msg;
-  if (msg instanceof Event)
-    failMessage = msg.target + '.' + msg.type;
-  console.log("FAILED TEST: " + msg);
-  setResultInTitle('FAILED');
-}
-
-var titleChanged = false;
-function setResultInTitle(title) {
-  // If document title is 'ENDED', then update it with new title to possibly
-  // mark a test as failure.  Otherwise, keep the first title change in place.
-  if (!titleChanged || document.title.toUpperCase() == 'ENDED')
-    document.title = title.toUpperCase();
-  console.log('Set document title to: ' + title + ', updated title: ' +
-              document.title);
-  titleChanged = true;
-}
-
-function installTitleEventHandler(element, event) {
-  element.addEventListener(event, function(e) {
-    setResultInTitle(event.toString());
-  }, false);
-}
-
-function convertToArray(input) {
-  if (Array.isArray(input))
-    return input;
-  return [input];
-}
diff --git a/content/test/data/media/mse_config_change.html b/content/test/data/media/mse_config_change.html
deleted file mode 100644
index 13f4174..0000000
--- a/content/test/data/media/mse_config_change.html
+++ /dev/null
@@ -1,132 +0,0 @@
-<html>
-  <head>
-    <title>Test media source config changes.</title>
-  </head>
-  <body onload="runTest();">
-    <video controls></video>
-    <script src="media_utils.js" type="text/javascript"></script>
-    <script src="media_source_utils.js" type="text/javascript"></script>
-    <script src="encrypted_media_utils.js" type="text/javascript"></script>
-    <script type="text/javascript">
-      var runEncrypted = QueryString.runencrypted == 1;
-      var video = document.querySelector('video');
-      var mediaType = 'video/webm; codecs="vorbis, vp8"';
-
-      var MEDIA_1 = 'bear-320x240.webm';
-      var MEDIA_2 = 'bear-640x360.webm';
-      if (runEncrypted) {
-        MEDIA_1 = 'bear-320x240-av-enc_av.webm';
-        MEDIA_2 = 'bear-640x360-av-enc_av.webm';
-      }
-
-      var MEDIA_1_WIDTH = 320;
-      var MEDIA_1_HEIGHT = 240;
-
-      var MEDIA_2_WIDTH = 640;
-      var MEDIA_2_HEIGHT = 360;
-      var MEDIA_2_LENGTH = 2.75;
-
-      // The time in secs to append the second media source.
-      var APPEND_TIME = 1;
-      // DELTA is the time after APPEND_TIME where the second video dimensions
-      // are guaranteed to take effect.
-      var DELTA = 0.1;
-      // Append MEDIA_2 source at APPEND_TIME, so expected total duration is:
-      var TOTAL_DURATION = APPEND_TIME + MEDIA_2_LENGTH;
-
-      function appendNextSource(mediaSource) {
-        console.log('Appending next media source at ' + APPEND_TIME + 'sec.');
-        var xhr = new XMLHttpRequest();
-        xhr.open("GET", MEDIA_2);
-        xhr.responseType = 'arraybuffer';
-        xhr.addEventListener('load', function(e) {
-          var onUpdateEnd = function(e) {
-            console.log('Second buffer append ended.');
-            srcBuffer.removeEventListener('updateend', onUpdateEnd);
-            mediaSource.endOfStream();
-            if (!mediaSource.duration ||
-                Math.abs(mediaSource.duration - TOTAL_DURATION) > DELTA) {
-              failTest('Unexpected mediaSource.duration = ' +
-                       mediaSource.duration + ', expected duration = ' +
-                       TOTAL_DURATION);
-              return;
-            }
-            video.play();
-          };
-          console.log('Appending next media source at ' + APPEND_TIME + 'sec.');
-          var srcBuffer = mediaSource.sourceBuffers[0];
-          srcBuffer.addEventListener('updateend', onUpdateEnd);
-          srcBuffer.timestampOffset = APPEND_TIME;
-          srcBuffer.appendBuffer(new Uint8Array(e.target.response));
-        });
-        xhr.send();
-      }
-
-      function onTimeUpdate() {
-        // crbug.com/246308
-        //checkVideoProperties();
-
-        // Seek to APPEND_TIME because after a seek a timeUpdate event is fired
-        // before video width and height properties get updated.
-        if (video.currentTime < APPEND_TIME - DELTA) {
-          // Seek to save test execution time (about 1 secs) and to test seek
-          // on the first buffer.
-          video.currentTime = APPEND_TIME - DELTA;
-        } else if (video.currentTime > APPEND_TIME + DELTA) {
-          // Check video duration here to guarantee that second segment has been
-          // appended and video total duration is updated.
-          // Video duration is a float value so we check it within a range.
-          if (!video.duration ||
-              Math.abs(video.duration - TOTAL_DURATION) > DELTA) {
-            failTest('Unexpected video.duration = ' + video.duration +
-                     ', expected duration = ' + TOTAL_DURATION);
-            return;
-          }
-
-          video.removeEventListener('timeupdate', onTimeUpdate);
-          video.removeEventListener('ended', failTest);
-          installTitleEventHandler(video, 'ended');
-          // Seek to save test execution time and to test seek on second buffer.
-          video.currentTime = APPEND_TIME + MEDIA_2_LENGTH * 0.9;
-        }
-      }
-
-      function checkVideoProperties() {
-        if (video.currentTime <= APPEND_TIME) {
-          if (video.videoWidth != MEDIA_1_WIDTH ||
-              video.videoHeight != MEDIA_1_HEIGHT) {
-            logVideoDimensions();
-            failTest('Unexpected dimensions for first video segment.');
-            return;
-          }
-        } else if (video.currentTime >= APPEND_TIME + DELTA) {
-          if (video.videoWidth != MEDIA_2_WIDTH ||
-              video.videoHeight != MEDIA_2_HEIGHT) {
-            logVideoDimensions();
-            failTest('Unexpected dimensions for second video segment.');
-            return;
-          }
-        }
-      }
-
-      function logVideoDimensions() {
-        console.log('video.currentTime = ' + video.currentTime +
-                    ', video dimensions = ' + video.videoWidth + 'x' +
-                    video.videoHeight + '.');
-      }
-
-      function runTest() {
-        video.addEventListener('timeupdate', onTimeUpdate);
-        video.addEventListener('ended', failTest);
-        if (runEncrypted) {
-          loadEncryptedMedia(video, MEDIA_1, keySystem, KEY, true,
-                             appendNextSource);
-        } else {
-          var mediaSource = loadMediaSource(MEDIA_1, mediaType,
-                                            appendNextSource);
-          video.src = window.URL.createObjectURL(mediaSource);
-        }
-      }
-      </script>
-  </body>
-</html>
diff --git a/media/BUILD.gn b/media/BUILD.gn
index 3e8a650..aa7daea 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -998,6 +998,7 @@
     ":media",
     ":shared_memory_support",
     "//base",
+    "//net:test_support",
     "//skia",
     "//testing/gmock",
     "//testing/gtest",
diff --git a/media/DEPS b/media/DEPS
index 8f61ef2..1275117 100644
--- a/media/DEPS
+++ b/media/DEPS
@@ -1,6 +1,7 @@
 include_rules = [
   "+gpu",
   "+jni",
+  "+net/test",
   "+third_party/ffmpeg",
   "+third_party/libvpx",
   "+third_party/libyuv",
diff --git a/media/base/test_data_util.cc b/media/base/test_data_util.cc
index a83fa84..9cd886f 100644
--- a/media/base/test_data_util.cc
+++ b/media/base/test_data_util.cc
@@ -12,14 +12,38 @@
 
 namespace media {
 
+const base::FilePath::CharType kTestDataPath[] =
+    FILE_PATH_LITERAL("media/test/data");
+
 base::FilePath GetTestDataFilePath(const std::string& name) {
   base::FilePath file_path;
   CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &file_path));
+  return file_path.Append(GetTestDataPath()).AppendASCII(name);
+}
 
-  return file_path.AppendASCII("media")
-      .AppendASCII("test")
-      .AppendASCII("data")
-      .AppendASCII(name);
+base::FilePath GetTestDataPath() {
+  return base::FilePath(kTestDataPath);
+}
+
+std::string GetURLQueryString(const QueryParams& query_params) {
+  std::string query = "";
+  QueryParams::const_iterator itr = query_params.begin();
+  for (; itr != query_params.end(); ++itr) {
+    if (itr != query_params.begin())
+      query.append("&");
+    query.append(itr->first + "=" + itr->second);
+  }
+  return query;
+}
+
+scoped_ptr<net::SpawnedTestServer> StartMediaHttpTestServer() {
+  scoped_ptr<net::SpawnedTestServer> http_test_server;
+  http_test_server.reset(new net::SpawnedTestServer(
+      net::SpawnedTestServer::TYPE_HTTP,
+      net::SpawnedTestServer::kLocalhost,
+      GetTestDataPath()));
+  CHECK(http_test_server->Start());
+  return http_test_server.Pass();
 }
 
 scoped_refptr<DecoderBuffer> ReadTestDataFile(const std::string& name) {
diff --git a/media/base/test_data_util.h b/media/base/test_data_util.h
index 8d51e96..955d615 100644
--- a/media/base/test_data_util.h
+++ b/media/base/test_data_util.h
@@ -6,19 +6,34 @@
 #define MEDIA_BASE_TEST_DATA_UTIL_H_
 
 #include <string>
+#include <utility>
+#include <vector>
 
 #include "base/basictypes.h"
 #include "base/files/file_path.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
+#include "net/test/spawned_test_server/spawned_test_server.h"
 
 namespace media {
 
 class DecoderBuffer;
 
+typedef std::vector<std::pair<std::string, std::string> > QueryParams;
+
 // Returns a file path for a file in the media/test/data directory.
 base::FilePath GetTestDataFilePath(const std::string& name);
 
+// Returns relative path for test data folder: media/test/data.
+base::FilePath GetTestDataPath();
+
+// Starts an HTTP server serving files from media data path.
+scoped_ptr<net::SpawnedTestServer> StartMediaHttpTestServer();
+
+// Returns a string containing key value query params in the form of:
+// "key_1=value_1&key_2=value2"
+std::string GetURLQueryString(const QueryParams& query_params);
+
 // Reads a test file from media/test/data directory and stores it in
 // a DecoderBuffer.  Use DecoderBuffer vs DataBuffer to ensure no matter
 // what a test does, it's safe to use FFmpeg methods.
diff --git a/media/media.gyp b/media/media.gyp
index 8ce7667..a6bfc9b7 100644
--- a/media/media.gyp
+++ b/media/media.gyp
@@ -1356,6 +1356,7 @@
         'media',
         'shared_memory_support',
         '../base/base.gyp:base',
+        '../net/net.gyp:net_test_support',
         '../skia/skia.gyp:skia',
         '../testing/gmock.gyp:gmock',
         '../testing/gtest.gyp:gtest',
diff --git a/content/test/data/media/blackwhite.html b/media/test/data/blackwhite.html
similarity index 100%
rename from content/test/data/media/blackwhite.html
rename to media/test/data/blackwhite.html
diff --git a/chrome/test/data/media/eme_player.html b/media/test/data/eme_player.html
similarity index 100%
rename from chrome/test/data/media/eme_player.html
rename to media/test/data/eme_player.html
diff --git a/chrome/test/data/media/eme_player_js/app_loader.js b/media/test/data/eme_player_js/app_loader.js
similarity index 100%
rename from chrome/test/data/media/eme_player_js/app_loader.js
rename to media/test/data/eme_player_js/app_loader.js
diff --git a/chrome/test/data/media/eme_player_js/clearkey_player.js b/media/test/data/eme_player_js/clearkey_player.js
similarity index 100%
rename from chrome/test/data/media/eme_player_js/clearkey_player.js
rename to media/test/data/eme_player_js/clearkey_player.js
diff --git a/chrome/test/data/media/eme_player_js/eme_app.js b/media/test/data/eme_player_js/eme_app.js
similarity index 100%
rename from chrome/test/data/media/eme_player_js/eme_app.js
rename to media/test/data/eme_player_js/eme_app.js
diff --git a/chrome/test/data/media/eme_player_js/file_io_test_player.js b/media/test/data/eme_player_js/file_io_test_player.js
similarity index 100%
rename from chrome/test/data/media/eme_player_js/file_io_test_player.js
rename to media/test/data/eme_player_js/file_io_test_player.js
diff --git a/chrome/test/data/media/eme_player_js/fps_observer.js b/media/test/data/eme_player_js/fps_observer.js
similarity index 100%
rename from chrome/test/data/media/eme_player_js/fps_observer.js
rename to media/test/data/eme_player_js/fps_observer.js
diff --git a/chrome/test/data/media/eme_player_js/globals.js b/media/test/data/eme_player_js/globals.js
similarity index 100%
rename from chrome/test/data/media/eme_player_js/globals.js
rename to media/test/data/eme_player_js/globals.js
diff --git a/chrome/test/data/media/eme_player_js/media_source_utils.js b/media/test/data/eme_player_js/media_source_utils.js
similarity index 97%
rename from chrome/test/data/media/eme_player_js/media_source_utils.js
rename to media/test/data/eme_player_js/media_source_utils.js
index d75f31c..8888582 100644
--- a/chrome/test/data/media/eme_player_js/media_source_utils.js
+++ b/media/test/data/eme_player_js/media_source_utils.js
@@ -1,4 +1,4 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
diff --git a/chrome/test/data/media/eme_player_js/player_utils.js b/media/test/data/eme_player_js/player_utils.js
similarity index 100%
rename from chrome/test/data/media/eme_player_js/player_utils.js
rename to media/test/data/eme_player_js/player_utils.js
diff --git a/chrome/test/data/media/eme_player_js/prefixed_clearkey_player.js b/media/test/data/eme_player_js/prefixed_clearkey_player.js
similarity index 100%
rename from chrome/test/data/media/eme_player_js/prefixed_clearkey_player.js
rename to media/test/data/eme_player_js/prefixed_clearkey_player.js
diff --git a/chrome/test/data/media/eme_player_js/prefixed_widevine_player.js b/media/test/data/eme_player_js/prefixed_widevine_player.js
similarity index 100%
rename from chrome/test/data/media/eme_player_js/prefixed_widevine_player.js
rename to media/test/data/eme_player_js/prefixed_widevine_player.js
diff --git a/media/test/data/eme_player_js/test_config.js b/media/test/data/eme_player_js/test_config.js
new file mode 100644
index 0000000..8be8a9a
--- /dev/null
+++ b/media/test/data/eme_player_js/test_config.js
@@ -0,0 +1,65 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Test configuration used by test page to configure the player app and other
+// test specific configurations.
+function TestConfig() {
+  this.mediaFile = null;
+  this.keySystem = null;
+  this.mediaType = null;
+  this.licenseServerURL = null;
+  this.useMSE = false;
+  this.usePrefixedEME = false;
+  this.runFPS = false;
+}
+
+TestConfig.prototype.loadQueryParams = function() {
+  // Load query parameters and set default values.
+  var r = /([^&=]+)=?([^&]*)/g;
+  // Lambda function for decoding extracted match values. Replaces '+' with
+  // space so decodeURIComponent functions properly.
+  var decodeURI = function decodeURI(s) {
+      return decodeURIComponent(s.replace(/\+/g, ' '));
+  };
+  var match;
+  while (match = r.exec(window.location.search.substring(1)))
+    this[decodeURI(match[1])] = decodeURI(match[2]);
+  this.useMSE = this.useMSE == '1' || this.useMSE == 'true';
+  this.usePrefixedEME =
+      this.usePrefixedEME == '1' || this.usePrefixedEME == 'true';
+};
+
+TestConfig.updateDocument = function() {
+  this.loadQueryParams();
+  Utils.addOptions(KEYSYSTEM_ELEMENT_ID, KEY_SYSTEMS);
+  Utils.addOptions(MEDIA_TYPE_ELEMENT_ID, MEDIA_TYPES);
+  Utils.addOptions(USE_PREFIXED_EME_ID, EME_VERSIONS_OPTIONS,
+                   EME_DISABLED_OPTIONS);
+
+  document.getElementById(MEDIA_FILE_ELEMENT_ID).value =
+      this.mediaFile || DEFAULT_MEDIA_FILE;
+
+  document.getElementById(LICENSE_SERVER_ELEMENT_ID).value =
+      this.licenseServerURL || DEFAULT_LICENSE_SERVER;
+
+  if (this.keySystem)
+    Utils.ensureOptionInList(KEYSYSTEM_ELEMENT_ID, this.keySystem);
+  if (this.mediaType)
+    Utils.ensureOptionInList(MEDIA_TYPE_ELEMENT_ID, this.mediaType);
+  document.getElementById(USE_MSE_ELEMENT_ID).value = this.useMSE;
+  if (this.usePrefixedEME)
+    document.getElementById(USE_PREFIXED_EME_ID).value = EME_PREFIXED_VERSION;
+};
+
+TestConfig.init = function() {
+  // Reload test configuration from document.
+  this.mediaFile = document.getElementById(MEDIA_FILE_ELEMENT_ID).value;
+  this.keySystem = document.getElementById(KEYSYSTEM_ELEMENT_ID).value;
+  this.mediaType = document.getElementById(MEDIA_TYPE_ELEMENT_ID).value;
+  this.useMSE = document.getElementById(USE_MSE_ELEMENT_ID).value == 'true';
+  this.usePrefixedEME = document.getElementById(USE_PREFIXED_EME_ID).value ==
+      EME_PREFIXED_VERSION;
+  this.licenseServerURL =
+      document.getElementById(LICENSE_SERVER_ELEMENT_ID).value;
+};
diff --git a/chrome/test/data/media/eme_player_js/utils.js b/media/test/data/eme_player_js/utils.js
similarity index 100%
rename from chrome/test/data/media/eme_player_js/utils.js
rename to media/test/data/eme_player_js/utils.js
diff --git a/chrome/test/data/media/eme_player_js/widevine_player.js b/media/test/data/eme_player_js/widevine_player.js
similarity index 100%
rename from chrome/test/data/media/eme_player_js/widevine_player.js
rename to media/test/data/eme_player_js/widevine_player.js
diff --git a/chrome/test/data/media/encrypted_frame_size_change.html b/media/test/data/encrypted_frame_size_change.html
similarity index 100%
rename from chrome/test/data/media/encrypted_frame_size_change.html
rename to media/test/data/encrypted_frame_size_change.html
diff --git a/content/test/data/media/media_source_player.html b/media/test/data/media_source_player.html
similarity index 60%
rename from content/test/data/media/media_source_player.html
rename to media/test/data/media_source_player.html
index 97f3b64..7a2ecbe 100644
--- a/content/test/data/media/media_source_player.html
+++ b/media/test/data/media_source_player.html
@@ -5,8 +5,7 @@
   </head>
   <body onload="runTest();">
     <video controls></video>
-    <script src="media_utils.js" type="text/javascript"></script>
-    <script src="media_source_utils.js" type="text/javascript"></script>
+    <script src='eme_player_js/app_loader.js' type='text/javascript'></script>
     <script type="text/javascript">
       var video = document.querySelector('video');
 
@@ -16,18 +15,22 @@
       }
 
       function onSeeked() {
-        video.removeEventListener('ended', failTest);
-        installTitleEventHandler(video, 'ended');
+        video.removeEventListener('ended', Utils.failTest);
+        Utils.installTitleEventHandler(video, 'ended');
       }
 
       // The test completes after media starts playing, seeks to 0.9 of
       // duration and fires the ended event.
       // The test stops when an error or ended event fire unexpectedly.
       function runTest() {
-        loadMediaFromURL(video);
-        video.addEventListener('ended', failTest);
+        var testConfig = new TestConfig();
+        testConfig.loadQueryParams();
+        Utils.installTitleEventHandler(video, 'error');
+        video.addEventListener('ended', Utils.failTest);
         video.addEventListener('seeked', onSeeked);
         video.addEventListener('timeupdate', onTimeUpdate);
+        var source = MediaSourceUtils.loadMediaSourceFromTestConfig(testConfig);
+        video.src = window.URL.createObjectURL(source);
         video.play();
       }
     </script>
diff --git a/chrome/test/data/media/mse_config_change.html b/media/test/data/mse_config_change.html
similarity index 97%
rename from chrome/test/data/media/mse_config_change.html
rename to media/test/data/mse_config_change.html
index 8765235..f536ece 100644
--- a/chrome/test/data/media/mse_config_change.html
+++ b/media/test/data/mse_config_change.html
@@ -8,7 +8,6 @@
     <script type="text/javascript">
       var testConfig = new TestConfig();
       testConfig.loadQueryParams();
-      testConfig.useMSE = '1';
       var runEncrypted = testConfig.runEncrypted == 1;
 
       var video = document.querySelector('video');
@@ -17,8 +16,8 @@
       var MEDIA_1 = 'bear-320x240.webm';
       var MEDIA_2 = 'bear-640x360.webm';
       if (runEncrypted) {
-        MEDIA_1 = 'bear-320x240-av-enc_av.webm';
-        MEDIA_2 = 'bear-640x360-av-enc_av.webm';
+        MEDIA_1 = 'bear-320x240-av_enc-av.webm';
+        MEDIA_2 = 'bear-640x360-av_enc-av.webm';
       }
 
       var MEDIA_1_WIDTH = 320;
diff --git a/content/test/data/media/player.html b/media/test/data/player.html
similarity index 100%
rename from content/test/data/media/player.html
rename to media/test/data/player.html
diff --git a/chrome/test/data/media/test_key_system_instantiation.html b/media/test/data/test_key_system_instantiation.html
similarity index 89%
rename from chrome/test/data/media/test_key_system_instantiation.html
rename to media/test/data/test_key_system_instantiation.html
index d3fb0e3..0199920 100644
--- a/chrome/test/data/media/test_key_system_instantiation.html
+++ b/media/test/data/test_key_system_instantiation.html
@@ -3,7 +3,7 @@
     <video controls="" name="video">
       <!-- This test doesn't play the video, so any file will do
            as long as it can be loaded. -->
-      <source src="bear-320x240-av-enc_a.webm" type="video/webm">
+      <source src="bear-320x240-av_enc-a.webm" type="video/webm">
     </video>
     <script type="text/javascript">
       function testKeySystemInstantiation(keySystem) {
