Revert "Clean up proprietary codec checks/expectations in LayoutTests"

This reverts commit 117b9d3a698a52d96857b31caeb72c2e74f2a782.

Reason for revert: CL is fine, but it depends on another CL that was reverted: https://chromium-review.googlesource.com/c/chromium/src/+/836414

That CL will probably land again, so expecting to reland this one as is % rebase.

Original change's description:
> Clean up proprietary codec checks/expectations in LayoutTests
> 
> This is mostly a reland of
> https://chromium-review.googlesource.com/c/chromium/src/+/807604
> with some improvements and now unblocked by changes to bots.
> 
> Media layout tests need repair
> 1) Many tests check for proprietary codec support by only asking about
>    "video/mp4" without specifying a codec. This check is busted
>    because MP4 is no longer considered proprietary while codecs like
>    H264 and AAC still are. We currently claim "video/mp4" is entirely
>    unsupported via test hacks to avoid breaking those checks.
> 2) Some MSE tests focus on MP4 with H264. While many bots now have the
>    needed codecs, we artificially remove their support via test-only
>    hacks in order to keep expectations the same for all runners.
> 
> This CL does the following
> 1) Remove incomplete checks for "video/mp4" - instead hardcode use of
>    the .ogv files (preserving the existing behavior).
> 2) Update MSE mp4/h264 test expectations to PASS. Starting this week
>    all webkit bots include the needed codecs.
> 3) Remove test hacks that artificially reduce codec support.
> 
> It is also not a goal to make LayoutTests try all the supported codecs.
> That is covered by unit/integration tests.
> 
> Due to 3) above, some external/wpt/media-source tests now fail because
> they select mp4. Fixing these failures is tracked in Issue 794338.
> 
> TBR: dalecurtis@chromium.org, peter@chromium.org
> Bug: 327115,746579,787575,568704,794338
> Change-Id: I8443d32fc9871c887d0009605cf8876521844916
> Reviewed-on: https://chromium-review.googlesource.com/827649
> Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
> Commit-Queue: Chrome Cunningham <chcunningham@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#525212}

TBR=dalecurtis@chromium.org,peter@chromium.org,chcunningham@chromium.org

Change-Id: I4dbb4a6ad23a18e2eab5af62a2d669a477e8eaf2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 327115, 746579, 787575, 568704, 794338
Reviewed-on: https://chromium-review.googlesource.com/837247
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Commit-Queue: Chrome Cunningham <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525391}
diff --git a/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc b/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc
index 958d7f33..96b3648 100644
--- a/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc
+++ b/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc
@@ -132,6 +132,13 @@
 }
 
 void LayoutTestContentRendererClient::RenderThreadStarted() {
+// Unless/until WebM files are added to the media layout tests, we need to
+// avoid removing MP4/H264/AAC so that layout tests can run on Android.
+// TODO(chcunningham): We should fix the tests to always use non-proprietary
+// codecs and just delete this code. http://crbug.com/787575
+#if !defined(OS_ANDROID)
+  media::RemoveProprietaryMediaTypesAndCodecsForTests();
+#endif
   ShellContentRendererClient::RenderThreadStarted();
   shell_observer_.reset(new LayoutTestRenderThreadObserver());
 }
diff --git a/media/base/mime_util.cc b/media/base/mime_util.cc
index 1409e8e..1bd72ff 100644
--- a/media/base/mime_util.cc
+++ b/media/base/mime_util.cc
@@ -55,4 +55,8 @@
       mime_type, codec_id, ambiguous_codec_string, out_codec);
 }
 
+void RemoveProprietaryMediaTypesAndCodecsForTests() {
+  GetMimeUtil()->RemoveProprietaryMediaTypesAndCodecs();
+}
+
 }  // namespace media
diff --git a/media/base/mime_util.h b/media/base/mime_util.h
index 33f01fe..0ff6703 100644
--- a/media/base/mime_util.h
+++ b/media/base/mime_util.h
@@ -85,6 +85,12 @@
 IsSupportedEncryptedMediaFormat(const std::string& mime_type,
                                 const std::vector<std::string>& codecs);
 
+// Test only method that removes proprietary media types and codecs from the
+// list of supported MIME types and codecs. These types and codecs must be
+// removed to ensure consistent layout test results across all Chromium
+// variations.
+MEDIA_EXPORT void RemoveProprietaryMediaTypesAndCodecsForTests();
+
 }  // namespace media
 
 #endif  // MEDIA_BASE_MIME_UTIL_H_
diff --git a/media/base/mime_util_internal.cc b/media/base/mime_util_internal.cc
index ed864dc..9c929b21 100644
--- a/media/base/mime_util_internal.cc
+++ b/media/base/mime_util_internal.cc
@@ -518,6 +518,25 @@
   return AreSupportedCodecs(parsed_results, mime_type_lower_case, is_encrypted);
 }
 
+void MimeUtil::RemoveProprietaryMediaTypesAndCodecs() {
+  for (const auto& container : proprietary_media_containers_)
+    media_format_map_.erase(container);
+
+  // TODO(chcunningham): Delete this hack (really this whole test-only method).
+  // This is done as short term workaround for LayoutTests to pass. MP4 is no
+  // longer proprietary, but may still contain proprietary codecs (e.g. AVC).
+  // Many  layout tests only check for container support and may break (absent
+  // this  hack) if run on a non-proprietary build. This mess is being fixed in
+  // https://chromium-review.googlesource.com/c/chromium/src/+/807604
+  media_format_map_.erase("video/mp4");
+  media_format_map_.erase("audio/mp4");
+  media_format_map_.erase("audio/mpeg");
+  media_format_map_.erase("audio/mp3");
+  media_format_map_.erase("audio/x-mp3");
+
+  allow_proprietary_codecs_ = false;
+}
+
 // static
 bool MimeUtil::IsCodecSupportedOnAndroid(
     Codec codec,
diff --git a/media/base/mime_util_internal.h b/media/base/mime_util_internal.h
index 7c528d4..d8677316 100644
--- a/media/base/mime_util_internal.h
+++ b/media/base/mime_util_internal.h
@@ -86,6 +86,8 @@
                                       const std::vector<std::string>& codecs,
                                       bool is_encrypted) const;
 
+  void RemoveProprietaryMediaTypesAndCodecs();
+
   // Checks android platform specific codec restrictions. Returns true if
   // |codec| is supported when contained in |mime_type_lower_case|.
   // |is_encrypted| means the codec will be used with encrypted blocks.
diff --git a/third_party/WebKit/LayoutTests/compositing/geometry/clipped-video-controller.html b/third_party/WebKit/LayoutTests/compositing/geometry/clipped-video-controller.html
index 5d11cbf..f0909ef 100644
--- a/third_party/WebKit/LayoutTests/compositing/geometry/clipped-video-controller.html
+++ b/third_party/WebKit/LayoutTests/compositing/geometry/clipped-video-controller.html
@@ -3,7 +3,7 @@
 <html>
 <head>
   <style>
-
+    
       #box {
         position: absolute;
         top: 50px;
@@ -13,14 +13,15 @@
         overflow: hidden;
         border: 10px solid green;
       }
-
+    
   </style>
   <script src="../resources/media-testing.js"></script>
+  <script src="../../media/media-file.js"></script>
 
   <script type="text/javascript" charset="utf-8">
     if (window.testRunner)
       testRunner.dumpAsText();
-
+  
     function testDone()
     {
       if (window.testRunner)
@@ -30,7 +31,7 @@
     function doTest()
     {
       var video = document.getElementsByTagName('video')[0];
-      setupVideo(video, '../resources/video.ogv', testDone);
+      setupVideo(video, '../resources/video', testDone);
     }
   </script>
 </head>
diff --git a/third_party/WebKit/LayoutTests/compositing/geometry/video-fixed-scrolling.html b/third_party/WebKit/LayoutTests/compositing/geometry/video-fixed-scrolling.html
index 72ff181..521430ab 100644
--- a/third_party/WebKit/LayoutTests/compositing/geometry/video-fixed-scrolling.html
+++ b/third_party/WebKit/LayoutTests/compositing/geometry/video-fixed-scrolling.html
@@ -8,13 +8,13 @@
     body {
       height: 1000px;
     }
-
+    
     video {
       margin-top: 80px;
       width: 400px;
       height: 300px;
     }
-
+    
     #fixed-bar {
       position: fixed;
       left: 0;
@@ -25,7 +25,8 @@
     }
   </style>
   <script src="../resources/media-testing.js"></script>
-    <script type="text/javascript" charset="utf-8">
+  <script src="../../media/media-file.js"></script>
+  <script type="text/javascript" charset="utf-8">
     function testDone()
     {
       window.scrollBy(50, 50);
@@ -36,7 +37,7 @@
     function doTest()
     {
       var video = document.getElementsByTagName('video')[0];
-      setupVideo(video, '../resources/video.ogv', testDone);
+      setupVideo(video, '../resources/video', testDone);
     }
   </script>
 </head>
diff --git a/third_party/WebKit/LayoutTests/compositing/geometry/video-opacity-overlay.html b/third_party/WebKit/LayoutTests/compositing/geometry/video-opacity-overlay.html
index 5259b28..4a5d6fc 100644
--- a/third_party/WebKit/LayoutTests/compositing/geometry/video-opacity-overlay.html
+++ b/third_party/WebKit/LayoutTests/compositing/geometry/video-opacity-overlay.html
@@ -6,21 +6,21 @@
       width: 100%;
       height: 100%;
     }
-
+    
     .container {
       position: relative;
       width: 400px;
       height: 300px;
       border: 1px solid black;
     }
-
+    
     .controls {
       opacity: 0.8;
       height: 10px;
       width: 10px;
       background-color: green;
     }
-
+    
     #control-bar {
       position: absolute;
       left: 0;
@@ -31,7 +31,8 @@
     }
   </style>
   <script src="../resources/media-testing.js"></script>
-    <script type="text/javascript" charset="utf-8">
+  <script src="../../media/media-file.js"></script>
+  <script type="text/javascript" charset="utf-8">
     function testDone()
     {
       if (window.testRunner)
@@ -41,7 +42,7 @@
     function doTest()
     {
       var video = document.getElementsByTagName('video')[0];
-      setupVideo(video, '../resources/video.ogv', testDone);
+      setupVideo(video, '../resources/video', testDone);
     }
   </script>
 </head>
diff --git a/third_party/WebKit/LayoutTests/compositing/layers-inside-overflow-scroll.html b/third_party/WebKit/LayoutTests/compositing/layers-inside-overflow-scroll.html
index 16191b6..0c8cbca 100644
--- a/third_party/WebKit/LayoutTests/compositing/layers-inside-overflow-scroll.html
+++ b/third_party/WebKit/LayoutTests/compositing/layers-inside-overflow-scroll.html
@@ -10,7 +10,7 @@
       margin: 10px;
       border: 1px solid black;
     }
-
+    
     #details {
      width: 300px;
      height: 150px;
@@ -25,7 +25,7 @@
       font-size: 24pt;
       line-height: 150%;
     }
-
+    
     .compositing {
       height: 100px;
       width: 100px;
@@ -34,6 +34,7 @@
     }
     </style>
     <script src="resources/media-testing.js"></script>
+    <script src="../media/media-file.js"></script>
 
     <script type="text/javascript" charset="utf-8">
       function testDone()
@@ -46,7 +47,7 @@
       function doTest()
       {
           var video = document.getElementsByTagName('video')[0];
-          setupVideo(video, 'resources/video.ogv', testDone);
+          setupVideo(video, 'resources/video', testDone);
       }
     </script>
   </head>
diff --git a/third_party/WebKit/LayoutTests/compositing/overflow/scroll-ancestor-update.html b/third_party/WebKit/LayoutTests/compositing/overflow/scroll-ancestor-update.html
index 8f3f1dd..33128f0 100644
--- a/third_party/WebKit/LayoutTests/compositing/overflow/scroll-ancestor-update.html
+++ b/third_party/WebKit/LayoutTests/compositing/overflow/scroll-ancestor-update.html
@@ -3,7 +3,7 @@
 <html>
 <head>
     <style type="text/css" media="screen">
-
+        
         body {
             margin: 0;
         }
@@ -12,7 +12,7 @@
             width: 100px;
             height: 100px;
         }
-
+        
         .container {
             position: absolute;
             top: 50px;
@@ -20,18 +20,18 @@
             height: 200px;
             width: 200px;
         }
-
+        
         #scroller {
             overflow-y: scroll;
             height: 200px;
             width: 200px;
             border: 1px solid black;
         }
-
+        
         .content {
             height: 500px;
         }
-
+        
         .box {
             height: 100px;
             width: 100px;
@@ -42,7 +42,7 @@
             margin-top: 50px;
             background-color: green;
         }
-
+        
         .indicator {
             position: absolute;
             left: 50px;
@@ -52,7 +52,8 @@
     </style>
 
     <script src="../resources/media-testing.js"></script>
-        <script type="text/javascript" charset="utf-8">
+    <script src="../../media/media-file.js"></script>
+    <script type="text/javascript" charset="utf-8">
       function testDone()
       {
         document.getElementById('scroller').scrollTop = 50;
@@ -63,12 +64,12 @@
       function doTest()
       {
         var video = document.getElementsByTagName('video')[0];
-        setupVideo(video, '../resources/video.ogv', testDone);
+        setupVideo(video, '../resources/video', testDone);
       }
     </script>
 </head>
 <body onload="doTest()">
-
+  
   <div class="indicator box"></div>
 
   <div class="container">
@@ -79,7 +80,7 @@
     </div>
     <p>The green box should obscure the red box, and move when you drag the scrollbar.</p>
   </div>
-
+  
   <video></video>
 
 </body>
diff --git a/third_party/WebKit/LayoutTests/compositing/reflections/load-video-in-reflection.html b/third_party/WebKit/LayoutTests/compositing/reflections/load-video-in-reflection.html
index b116503..14e7293 100644
--- a/third_party/WebKit/LayoutTests/compositing/reflections/load-video-in-reflection.html
+++ b/third_party/WebKit/LayoutTests/compositing/reflections/load-video-in-reflection.html
@@ -8,7 +8,7 @@
       width: 300px;
       -webkit-animation: spin 18s infinite linear;
     }
-
+    
     video {
       -webkit-box-reflect: below;
       background-color: red;
@@ -21,7 +21,8 @@
 
   </style>
   <script src="../resources/media-testing.js"></script>
-    <script type="text/javascript" charset="utf-8">
+  <script src="../../media/media-file.js"></script>
+  <script type="text/javascript" charset="utf-8">
     function testDone()
     {
       if (window.testRunner)
@@ -31,7 +32,7 @@
     function doTest()
     {
       var video = document.getElementsByTagName('video')[0];
-      setupVideo(video, '../resources/video.ogv', testDone);
+      setupVideo(video, '../resources/video', testDone);
     }
   </script>
 </head>
diff --git a/third_party/WebKit/LayoutTests/compositing/resources/media-testing.js b/third_party/WebKit/LayoutTests/compositing/resources/media-testing.js
index 9700ddc1..ace3320 100644
--- a/third_party/WebKit/LayoutTests/compositing/resources/media-testing.js
+++ b/third_party/WebKit/LayoutTests/compositing/resources/media-testing.js
@@ -4,6 +4,7 @@
 
 function setupVideo(videoElement, videoPath, canPlayThroughCallback)
 {
+    var mediaFile = findMediaFile("video", videoPath);
     videoElement.addEventListener("canplaythrough", canPlayThroughCallback);
-    videoElement.src = videoPath;
+    videoElement.src = mediaFile;
 }
diff --git a/third_party/WebKit/LayoutTests/compositing/self-painting-layers.html b/third_party/WebKit/LayoutTests/compositing/self-painting-layers.html
index 8d92a70c..f4b4fd57 100644
--- a/third_party/WebKit/LayoutTests/compositing/self-painting-layers.html
+++ b/third_party/WebKit/LayoutTests/compositing/self-painting-layers.html
@@ -10,7 +10,7 @@
       margin: 10px;
       border: 1px solid black;
     }
-
+    
     #details {
      width: 300px;
      height: 150px;
@@ -28,6 +28,7 @@
     </style>
 
     <script src="resources/media-testing.js"></script>
+    <script src="../media/media-file.js"></script>
 
     <script type="text/javascript" charset="utf-8">
       function testDone()
@@ -40,7 +41,7 @@
       function doTest()
       {
         var video = document.getElementsByTagName('video')[0];
-        setupVideo(video, 'resources/video.ogv', testDone);
+        setupVideo(video, 'resources/video', testDone);
       }
     </script>
   </head>
diff --git a/third_party/WebKit/LayoutTests/compositing/video/video-reflection.html b/third_party/WebKit/LayoutTests/compositing/video/video-reflection.html
index 317db2b..3312ea4 100644
--- a/third_party/WebKit/LayoutTests/compositing/video/video-reflection.html
+++ b/third_party/WebKit/LayoutTests/compositing/video/video-reflection.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <title>Test "-webkit-box-reflect" property on a video element.</title>
 <script src="../../resources/run-after-layout-and-paint.js"></script>
+<script src="../../media/media-file.js"></script>
 <style>
 video {
     -webkit-box-reflect: below 0px;
@@ -18,6 +19,6 @@
     runAfterLayoutAndPaint(function() {}, true);
 };
 
-video.src = '../../media/content/test.ogv';
+video.src = findMediaFile('video', '../../media/content/test');
 video.currentTime = 1;
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/compositing/visibility/visibility-simple-video-layer.html b/third_party/WebKit/LayoutTests/compositing/visibility/visibility-simple-video-layer.html
index f7e7dbd..42d13f1 100644
--- a/third_party/WebKit/LayoutTests/compositing/visibility/visibility-simple-video-layer.html
+++ b/third_party/WebKit/LayoutTests/compositing/visibility/visibility-simple-video-layer.html
@@ -29,7 +29,8 @@
     </style>
 
     <script src="../resources/media-testing.js"></script>
-        <script type="text/javascript" charset="utf-8">
+    <script src="../../media/media-file.js"></script>
+    <script type="text/javascript" charset="utf-8">
       if (window.testRunner)
           testRunner.dumpAsTextWithPixelResults();
 
@@ -42,9 +43,9 @@
 
       function doTest()
       {
-          setupVideo(document.getElementsByTagName('video')[0], '../resources/video.ogv', notifyVideoDone);
-          setupVideo(document.getElementsByTagName('video')[1], '../resources/video.ogv', notifyVideoDone);
-          setupVideo(document.getElementsByTagName('video')[2], '../resources/video.ogv', notifyVideoDone);
+          setupVideo(document.getElementsByTagName('video')[0], '../resources/video', notifyVideoDone);
+          setupVideo(document.getElementsByTagName('video')[1], '../resources/video', notifyVideoDone);
+          setupVideo(document.getElementsByTagName('video')[2], '../resources/video', notifyVideoDone);
       }
     </script>
   </head>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt
index 5437203..5096c82b 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt
@@ -1,10 +1,10 @@
 This is a testharness.js-based test.
-Found 59 tests; 54 PASS, 5 FAIL, 0 TIMEOUT, 0 NOTRUN.
+Found 59 tests; 46 PASS, 13 FAIL, 0 TIMEOUT, 0 NOTRUN.
 PASS utility code
 PASS application/octet-stream
 PASS video/x-new-fictional-format
-PASS audio/mp4 (optional)
-PASS audio/mp4; codecs="mp4a.40.2" (optional)
+FAIL audio/mp4 (optional) assert_equals: audio/mp4 expected "maybe" but got ""
+FAIL audio/mp4; codecs="mp4a.40.2" (optional) assert_equals: audio/mp4; codecs="mp4a.40.2" expected "probably" but got ""
 PASS audio/mp4 with bogus codec
 PASS audio/mp4 with and without codecs
 PASS audio/ogg (optional)
@@ -28,12 +28,12 @@
 PASS video/3gpp codecs order
 PASS video/3gpp with bogus codec
 PASS video/3gpp with and without codecs
-PASS video/mp4 (optional)
-PASS video/mp4; codecs="mp4a.40.2" (optional)
-PASS video/mp4; codecs="avc1.42E01E" (optional)
-PASS video/mp4; codecs="avc1.4D401E" (optional)
-PASS video/mp4; codecs="avc1.58A01E" (optional)
-PASS video/mp4; codecs="avc1.64001E" (optional)
+FAIL video/mp4 (optional) assert_equals: video/mp4 expected "maybe" but got ""
+FAIL video/mp4; codecs="mp4a.40.2" (optional) assert_equals: video/mp4; codecs="mp4a.40.2" expected "probably" but got ""
+FAIL video/mp4; codecs="avc1.42E01E" (optional) assert_equals: video/mp4; codecs="avc1.42E01E" expected "probably" but got ""
+FAIL video/mp4; codecs="avc1.4D401E" (optional) assert_equals: video/mp4; codecs="avc1.4D401E" expected "probably" but got ""
+FAIL video/mp4; codecs="avc1.58A01E" (optional) assert_equals: video/mp4; codecs="avc1.58A01E" expected "probably" but got ""
+FAIL video/mp4; codecs="avc1.64001E" (optional) assert_equals: video/mp4; codecs="avc1.64001E" expected "probably" but got ""
 FAIL video/mp4; codecs="mp4v.20.8" (optional) assert_equals: video/mp4; codecs="mp4v.20.8" expected "probably" but got ""
 FAIL video/mp4; codecs="mp4v.20.240" (optional) assert_equals: video/mp4; codecs="mp4v.20.240" expected "probably" but got ""
 PASS video/mp4 codecs subset
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-expected.txt
index 8df4efd..ecaf93e 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-expected.txt
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-expected.txt
@@ -7,8 +7,8 @@
 PASS Test addSourceBuffer() with Vorbis and VP8 in separate SourceBuffers
 PASS Test addSourceBuffer() video only
 PASS Test addSourceBuffer() audio only
-PASS Test addSourceBuffer() with AAC and H.264
-PASS Test addSourceBuffer() with AAC and H.264 in separate SourceBuffers
+FAIL Test addSourceBuffer() with AAC and H.264 assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported expected true got false
+FAIL Test addSourceBuffer() with AAC and H.264 in separate SourceBuffers assert_true: video/mp4;codecs="avc1.4D4001" is supported expected true got false
 FAIL Test addSourceBuffer() QuotaExceededError. assert_true: Reached SourceBuffer limit. expected true got false
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-mode-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-mode-expected.txt
index 3b81c8d..8768da7 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-mode-expected.txt
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-addsourcebuffer-mode-expected.txt
@@ -1,5 +1,5 @@
 This is a testharness.js-based test.
 PASS addSourceBuffer() sets SourceBuffer.mode to 'segments' when the generate timestamps flag is false
-FAIL addSourceBuffer() sets SourceBuffer.mode to 'sequence' when the generate timestamps flag is true assert_equals: expected "sequence" but got "segments"
+FAIL addSourceBuffer() sets SourceBuffer.mode to 'sequence' when the generate timestamps flag is true assert_unreached: Browser does not support the audio/aac and audio/mpeg MIME types used in this test Reached unreachable code
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-buffered-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-buffered-expected.txt
index 08389f9..28ae3356 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-buffered-expected.txt
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-buffered-expected.txt
@@ -1,7 +1,7 @@
 This is a testharness.js-based test.
-FAIL Demuxed content with different lengths assert_equals: mediaSource.activeSourceBuffers[1] expected "{ [0.067, 2.067) }" but got "{ [0.000, 2.000) }"
-FAIL Muxed content with different lengths assert_equals: mediaSource.activeSourceBuffers[0] expected "{ [0.067, 2.043) }" but got "{ [0.000, 2.000) }"
-PASS Demuxed content with an empty buffered range on one SourceBuffer
+FAIL Demuxed content with different lengths assert_equals: mediaSource.activeSourceBuffers[0] expected "{ [0.000, 2.023) }" but got "{ [0.000, 2.022) }"
+FAIL Muxed content with different lengths assert_equals: mediaSource.activeSourceBuffers[0] expected "{ [0.003, 2.004) }" but got "{ [0.000, 2.003) }"
+FAIL Demuxed content with an empty buffered range on one SourceBuffer assert_equals: mediaSource.activeSourceBuffers[0] expected "{ [0.000, 2.023) }" but got "{ [0.000, 2.022) }"
 PASS Muxed content empty buffered ranges.
 PASS Get buffered range when sourcebuffer is empty.
 PASS Get buffered range when only init segment is appended.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt
new file mode 100644
index 0000000..fa56a24
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt
@@ -0,0 +1,4 @@
+This is a testharness.js-based test.
+FAIL Tests mp4 audio-only bitrate changes. assert_true: audio/mp4;codecs="mp4a.40.2" is supported. expected true got false
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt
new file mode 100644
index 0000000..2b7793b3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt
@@ -0,0 +1,4 @@
+This is a testharness.js-based test.
+FAIL Tests mp4 audio bitrate changes in multiplexed content. assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported. expected true got false
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-framesize-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-framesize-expected.txt
new file mode 100644
index 0000000..3e82c6e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-framesize-expected.txt
@@ -0,0 +1,4 @@
+This is a testharness.js-based test.
+FAIL Tests mp4 frame size changes in multiplexed content. assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported. expected true got false
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt
new file mode 100644
index 0000000..8efe81a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt
@@ -0,0 +1,4 @@
+This is a testharness.js-based test.
+FAIL Tests mp4 video bitrate changes in multiplexed content. assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported. expected true got false
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt
new file mode 100644
index 0000000..8f53878c6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt
@@ -0,0 +1,4 @@
+This is a testharness.js-based test.
+FAIL Tests mp4 video-only bitrate changes. assert_true: video/mp4;codecs="avc1.4D4001" is supported. expected true got false
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-framerate-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-framerate-expected.txt
new file mode 100644
index 0000000..61e3e73
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-framerate-expected.txt
@@ -0,0 +1,4 @@
+This is a testharness.js-based test.
+FAIL Tests mp4 video-only frame rate changes. assert_true: video/mp4;codecs="avc1.4D4001" is supported. expected true got false
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-framesize-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-framesize-expected.txt
new file mode 100644
index 0000000..9f613a78
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-config-change-mp4-v-framesize-expected.txt
@@ -0,0 +1,4 @@
+This is a testharness.js-based test.
+FAIL Tests mp4 video-only frame size changes. assert_true: video/mp4;codecs="avc1.4D4001" is supported. expected true got false
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream-expected.txt
index 3e32022..f5c8646f 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream-expected.txt
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream-expected.txt
@@ -1,6 +1,6 @@
 This is a testharness.js-based test.
 FAIL MediaSource.endOfStream(): duration truncated to 0 when there are no buffered coded frames assert_equals: expected 0 but got 2
 PASS MediaSource.endOfStream(): media element notified that it now has all of the media data
-FAIL MediaSource.endOfStream(): duration and buffered range end time before and after endOfStream assert_equals: SegmentInfo duration should still roughly match mediaSource duration expected 6.548 but got 6.549
+PASS MediaSource.endOfStream(): duration and buffered range end time before and after endOfStream
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream.html b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream.html
index 5b6114f..bca80af8 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-endofstream.html
@@ -52,8 +52,7 @@
             // Note that segmentInfo.duration is expected to also be the
             // highest track buffer range end time. Therefore, endOfStream() should
             // not change duration with this media.
-            assert_equals(threeDecimalPlaces(segmentInfo.duration), threeDecimalPlaces(mediaSource.duration),
-                'SegmentInfo duration should initially roughly match mediaSource duration');
+            assert_equals(threeDecimalPlaces(segmentInfo.duration), threeDecimalPlaces(mediaSource.duration));
             assert_less_than_equal(highestEndTime, mediaSource.duration,
                 'Media duration may be slightly longer than intersected track buffered ranges');
 
@@ -65,8 +64,7 @@
             assert_equals(sourceBuffer.buffered.length, 1,
               'Media data properly buffered after endOfStream');
 
-            assert_equals(threeDecimalPlaces(segmentInfo.duration), threeDecimalPlaces(mediaSource.duration),
-                'SegmentInfo duration should still roughly match mediaSource duration');
+            assert_equals(threeDecimalPlaces(segmentInfo.duration), threeDecimalPlaces(mediaSource.duration));
             assert_less_than_equal(highestEndTime, mediaSource.duration,
                 'Media duration may be slightly longer than intersected track buffered ranges');
             assert_equals(sourceBuffer.buffered.end(0), mediaSource.duration,
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-is-type-supported-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-is-type-supported-expected.txt
new file mode 100644
index 0000000..98a290e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-is-type-supported-expected.txt
@@ -0,0 +1,43 @@
+This is a testharness.js-based test.
+PASS Test invalid MIME format "video"
+PASS Test invalid MIME format "video/"
+PASS Test invalid MIME format "video/webm"
+PASS Test invalid MIME format "video/webm;"
+PASS Test invalid MIME format "video/webm;codecs"
+PASS Test invalid MIME format "video/webm;codecs="
+PASS Test invalid MIME format "video/webm;codecs=""
+PASS Test invalid MIME format "video/webm;codecs="""
+PASS Test invalid MIME format "video/webm;codecs=",""
+PASS Test invalid MIME format ""
+PASS Test invalid MIME format "null"
+PASS Test invalid MSE MIME media type "xxx"
+PASS Test invalid MSE MIME media type "text/html"
+PASS Test invalid MSE MIME media type "image/jpeg"
+PASS Test invalid mismatch between major type and codec ID "audio/webm;codecs="vp8""
+PASS Test invalid mismatch between major type and codec ID "audio/mp4;codecs="avc1.4d001e""
+PASS Test invalid mismatch between minor type and codec ID "audio/mp4;codecs="vorbis""
+PASS Test invalid mismatch between minor type and codec ID "audio/webm;codecs="mp4a.40.2""
+PASS Test invalid mismatch between minor type and codec ID "video/mp4;codecs="vp8""
+PASS Test invalid mismatch between minor type and codec ID "video/webm;codecs="mp4a.40.2""
+PASS Test invalid mismatch between minor type and codec ID "video/mp4;codecs="vorbis""
+PASS Test invalid codec ID "audio/mp4;codecs="mp4a""
+PASS Test invalid codec ID "audio/mp4;codecs="mp4a.40""
+PASS Test invalid codec ID "audio/mp4;codecs="mp4a.40.""
+PASS Test invalid codec ID "audio/mp4;codecs="mp4a.67.3""
+PASS Test valid WebM type "video/webm;codecs="vp8""
+PASS Test valid WebM type "video/webm;codecs="vorbis""
+PASS Test valid WebM type "video/webm;codecs="vp8,vorbis""
+PASS Test valid WebM type "video/webm;codecs="vorbis, vp8""
+PASS Test valid WebM type "audio/webm;codecs="vorbis""
+PASS Test valid WebM type "AUDIO/WEBM;CODECS="vorbis""
+FAIL Test valid MP4 type "video/mp4;codecs="avc1.4d001e"" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "video/mp4;codecs="avc1.42001e"" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "audio/mp4;codecs="mp4a.40.2"" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "audio/mp4;codecs="mp4a.40.5"" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "audio/mp4;codecs="mp4a.67"" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "video/mp4;codecs="mp4a.40.2"" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.2"" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "video/mp4;codecs="mp4a.40.2 , avc1.4d001e "" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.5"" assert_equals: supported expected true but got false
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sequencemode-append-buffer-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sequencemode-append-buffer-expected.txt
index 349102a..2a09f25 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sequencemode-append-buffer-expected.txt
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sequencemode-append-buffer-expected.txt
@@ -1,6 +1,6 @@
 This is a testharness.js-based test.
-FAIL Test sequence AppendMode appendBuffer(first media segment) assert_equals: sourceBuffer.buffered range begins where expected before EOS expected 0.095 but got 0
-FAIL Test sequence AppendMode appendBuffer(second media segment) assert_equals: Event types match. expected "update" but got "updateend"
-FAIL Test sequence AppendMode appendBuffer(second media segment, then first media segment) assert_equals: Event types match. expected "update" but got "updateend"
+FAIL Test sequence AppendMode appendBuffer(first media segment) assert_equals: sourceBuffer.buffered range begins where expected before EOS expected 0.112 but got 0
+FAIL Test sequence AppendMode appendBuffer(second media segment) assert_equals: sourceBuffer.buffered range begins where expected before EOS expected 0.001 but got 0
+FAIL Test sequence AppendMode appendBuffer(second media segment, then first media segment) assert_equals: expectedTimestampOffset expected 0.802 but got 0.801
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sourcebuffer-mode-timestamps-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sourcebuffer-mode-timestamps-expected.txt
index 738b6287..420841f2 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sourcebuffer-mode-timestamps-expected.txt
+++ b/third_party/WebKit/LayoutTests/external/wpt/media-source/mediasource-sourcebuffer-mode-timestamps-expected.txt
@@ -1,9 +1,5 @@
 This is a testharness.js-based test.
-FAIL audio/aac : If generate timestamps flag equals true and new mode equals "segments", then throw a TypeError exception and abort these steps. assert_throws: SourceBuffer#mode with generate timestamps flag true function "function () {
-                              sourceBuffer.mode = "segments";
-                          }" did not throw
-FAIL audio/mpeg : If generate timestamps flag equals true and new mode equals "segments", then throw a TypeError exception and abort these steps. assert_throws: SourceBuffer#mode with generate timestamps flag true function "function () {
-                              sourceBuffer.mode = "segments";
-                          }" did not throw
+FAIL audio/aac : If generate timestamps flag equals true and new mode equals "segments", then throw a TypeError exception and abort these steps. assert_unreached: Browser doesn't support the MIME used in this test: audio/aac Reached unreachable code
+FAIL audio/mpeg : If generate timestamps flag equals true and new mode equals "segments", then throw a TypeError exception and abort these steps. assert_unreached: Browser doesn't support the MIME used in this test: audio/mpeg Reached unreachable code
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video-shadow.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video-shadow.html
index b54321c..04b3a17 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video-shadow.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video-shadow.html
@@ -22,8 +22,8 @@
     <div><table id='outputtable'></table></div>
     <div>Test Video</div>
     <div><video id="video">
-      <source src="resources/canvas_video.webm" type='video/webm' />
       <source src="resources/canvas_video.mp4"  type='video/mp4' />
+      <source src="resources/canvas_video.webm" type='video/webm' />
       <source src="resources/canvas_video.ogv"  type='video/ogg' />
     </video></div>
     <script type="application/x-javascript">
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video.html
index 73b6e4af..6f63ed1 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-video.html
@@ -22,8 +22,8 @@
     <div><table id='outputtable'></table></div>
     <div>Test Video</div>
     <div><video id="video">
-      <source src="resources/canvas_video.webm" type='video/webm' />
       <source src="resources/canvas_video.mp4"  type='video/mp4' />
+      <source src="resources/canvas_video.webm" type='video/webm' />
       <source src="resources/canvas_video.ogv"  type='video/ogg' />
     </video></div>
     <script type="application/x-javascript">
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-video.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-video.html
index 480496e0..b90614ab 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-video.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-video.html
@@ -10,8 +10,8 @@
 <body>
   <canvas id="canvas"></canvas>
   <video id="video">
-    <source src="resources/canvas_video.webm" type='video/webm' />
     <source src="resources/canvas_video.mp4"  type='video/mp4' />
+    <source src="resources/canvas_video.webm" type='video/webm' />
     <source src="resources/canvas_video.ogv"  type='video/ogg' />
   </video>
   <script>
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-pattern-video.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-pattern-video.html
index f26f242..293dd460 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-pattern-video.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-pattern-video.html
@@ -10,8 +10,8 @@
 <body>
   <canvas id="canvas"></canvas>
   <video id="video">
-    <source src="resources/canvas_video.webm" type='video/webm' />
     <source src="resources/canvas_video.mp4"  type='video/mp4' />
+    <source src="resources/canvas_video.webm" type='video/webm' />
     <source src="resources/canvas_video.ogv"  type='video/ogg' />
   </video>
   <script>
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/yuv-video-on-accelerated-canvas.html b/third_party/WebKit/LayoutTests/fast/canvas/yuv-video-on-accelerated-canvas.html
index 493ad00..03b9993 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/yuv-video-on-accelerated-canvas.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/yuv-video-on-accelerated-canvas.html
@@ -26,8 +26,8 @@
   <canvas id="hw-canvas" width=300 height=300></canvas>
   <canvas id="sw-canvas" width=150 height=150></canvas>
   <video id="video" loop>
-    <source src="resources/canvas_video.webm" type='video/webm' />
     <source src="resources/canvas_video.mp4"  type='video/mp4' />
+    <source src="resources/canvas_video.webm" type='video/webm' />
     <source src="resources/canvas_video.ogv"  type='video/ogg' />
   </video>
   <script>
diff --git a/third_party/WebKit/LayoutTests/fast/events/media-focus-in-standalone-media-document.html b/third_party/WebKit/LayoutTests/fast/events/media-focus-in-standalone-media-document.html
index 40b82d0..76d1c38 100644
--- a/third_party/WebKit/LayoutTests/fast/events/media-focus-in-standalone-media-document.html
+++ b/third_party/WebKit/LayoutTests/fast/events/media-focus-in-standalone-media-document.html
@@ -2,11 +2,12 @@
 <title>This tests that  media element in a standalone media document cannot be focused directly using focus() method or by mouse click.</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../../media/media-file.js"></script>
 <iframe width="380" height="330"></iframe>
 <script>
 async_test(function(t) {
     var iframe = document.querySelector("iframe");
-    iframe.src = "../../media/" + "content/test.ogv";
+    iframe.src = "../../media/" + findMediaFile("video", "content/test");
 
     iframe.onload = t.step_func(function() {
         var standaloneMediaDocument = iframe.contentDocument;
diff --git a/third_party/WebKit/LayoutTests/fast/overflow/overflow-of-video-outline.html b/third_party/WebKit/LayoutTests/fast/overflow/overflow-of-video-outline.html
index c30c719a..8d66d5c 100644
--- a/third_party/WebKit/LayoutTests/fast/overflow/overflow-of-video-outline.html
+++ b/third_party/WebKit/LayoutTests/fast/overflow/overflow-of-video-outline.html
@@ -2,6 +2,7 @@
 <head>
 </head>
 <script src="../../media/media-controls.js"></script>
+<script src="../../media/media-file.js"></script>
 
  <video id=video  controls width=400>
   </video>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/resources/video.html b/third_party/WebKit/LayoutTests/fullscreen/resources/video.html
index 4d9febe..aba93ee2 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/resources/video.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/resources/video.html
@@ -1,4 +1,5 @@
 <!DOCTYPE html>
+<script src="../../media/media-file.js"></script>
 <script>
 function canplaythrough() {
     parent.postMessage("Video loaded", "*");
@@ -10,7 +11,7 @@
 
 onload = function() {
     var video = document.getElementById('video');
-    var mediaFile = "../../media/content/test.ogv";
+    var mediaFile = findMediaFile("video", "../../media/content/test");
     video.src = mediaFile;
     video.addEventListener('canplaythrough', canplaythrough);
     video.addEventListener('webkitfullscreenchange', fullscreenChanged);
diff --git a/third_party/WebKit/LayoutTests/fullscreen/video-controls-timeline.html b/third_party/WebKit/LayoutTests/fullscreen/video-controls-timeline.html
index 16da8863..ee23de3 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/video-controls-timeline.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/video-controls-timeline.html
@@ -7,7 +7,8 @@
     </script>
     <script src="full-screen-test.js"></script>
     <script src="../media/media-controls.js"></script>
-        <script>
+    <script src="../media/media-file.js"></script>
+    <script>
         var video = document.getElementById('video');
         var timeline;
 
@@ -32,6 +33,6 @@
             runWithKeyDown(function(){video.webkitRequestFullScreen()});
         });
 
-        video.src = '../media/content/test.ogv';
+        video.src = findMediaFile('video', '../media/content/test');
     </script>
 </body>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/video-specified-size.html b/third_party/WebKit/LayoutTests/fullscreen/video-specified-size.html
index 3a60f7f5..3b283a32 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/video-specified-size.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/video-specified-size.html
@@ -7,7 +7,7 @@
     <script src="full-screen-test.js"></script>
     <script src=../media/media-file.js></script>
     <script>
-        setSrcById("video", "../media/content/test.ogv");
+        setSrcById("video", findMediaFile("video", "../media/content/test"));
         var video = document.getElementById('video');
         waitForEventTestAndEnd(document, 'webkitfullscreenchange', "video.clientWidth==document.body.clientWidth");
         runWithKeyDown(function(){video.webkitRequestFullScreen()});
diff --git a/third_party/WebKit/LayoutTests/hdr/color-profile-video.html b/third_party/WebKit/LayoutTests/hdr/color-profile-video.html
index 0365c6a..6058fc33 100644
--- a/third_party/WebKit/LayoutTests/hdr/color-profile-video.html
+++ b/third_party/WebKit/LayoutTests/hdr/color-profile-video.html
@@ -35,7 +35,7 @@
     };
   }
 
-  setSrcByTagName('video', '../media/content/test.ogv');
+  setSrcByTagName('video', findMediaFile('video', '../media/content/test'));
 };
 </script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/hdr/video-canvas-alpha.html b/third_party/WebKit/LayoutTests/hdr/video-canvas-alpha.html
index a24bc9f..b6376bf 100644
--- a/third_party/WebKit/LayoutTests/hdr/video-canvas-alpha.html
+++ b/third_party/WebKit/LayoutTests/hdr/video-canvas-alpha.html
@@ -1,5 +1,6 @@
 <html>
  <head>
+  <script src="../media/media-file.js"></script>
 
   <script>
     if (window.testRunner) {
@@ -8,7 +9,7 @@
 
     function onLoad() {
       video = document.getElementsByTagName('video')[0];
-      video.src = "../media/content/test.ogv";
+      video.src = findMediaFile("video", "../media/content/test");
 
       canvas = document.getElementsByTagName('canvas')[0];
       ctx = canvas.getContext('2d');
diff --git a/third_party/WebKit/LayoutTests/http/tests/appcache/video.html b/third_party/WebKit/LayoutTests/http/tests/appcache/video.html
index 0ed8c09..106b624 100644
--- a/third_party/WebKit/LayoutTests/http/tests/appcache/video.html
+++ b/third_party/WebKit/LayoutTests/http/tests/appcache/video.html
@@ -3,6 +3,7 @@
 <title>Test that "video" can be loaded from the application cache.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="/media-resources/media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -18,14 +19,14 @@
         // Setting "src" to file specified in manifest. This file should load.
         video.ondurationchange = t.step_func(test2);
         video.onerror = t.unreached_func();
-        video.src = "/media-resources/content/test.ogv";
+        video.src = "/media-resources/content/" + findMediaFile("video", "test");
     }
 
     function test2() {
         // Setting "src" to valid media file not in manifest. This file should fail to load.
         video.ondurationchange = t.unreached_func();
         video.onerror = t.step_func(test3);
-        video.src = "/media-resources/content/silence.oga";
+        video.src = "/media-resources/content/" + findMediaFile("audio", "silence");
     }
 
     function test3() {
diff --git a/third_party/WebKit/LayoutTests/http/tests/canvas/webgl/origin-clean-conformance-expected.txt b/third_party/WebKit/LayoutTests/http/tests/canvas/webgl/origin-clean-conformance-expected.txt
index bfef0a8..ca9217c 100644
--- a/third_party/WebKit/LayoutTests/http/tests/canvas/webgl/origin-clean-conformance-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/canvas/webgl/origin-clean-conformance-expected.txt
@@ -2,6 +2,7 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
+PASS Playable video format found
 PASS img was loaded
 
 check that an attempt to upload an image from another origin throws an exception.
diff --git a/third_party/WebKit/LayoutTests/http/tests/canvas/webgl/origin-clean-conformance.html b/third_party/WebKit/LayoutTests/http/tests/canvas/webgl/origin-clean-conformance.html
index 194ccad..8088328a 100644
--- a/third_party/WebKit/LayoutTests/http/tests/canvas/webgl/origin-clean-conformance.html
+++ b/third_party/WebKit/LayoutTests/http/tests/canvas/webgl/origin-clean-conformance.html
@@ -86,14 +86,34 @@
 
 function init() {
   var video = document.getElementById("video");
-  if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
+
+  var base = "http://localhost:8000/resources/";
+  var videos = [
+    ["video/mp4", base + "test.mp4"],
+    ["video/ogg", base + "test.ogv"],
+  ];
+  var videoFile = null;
+  for (var i = 0; i < videos.length; ++i) {
+    if (video.canPlayType(videos[i][0])) {
+      videoFile = videos[i][1];
+      break;
+    }
   }
-  video.src = "http://localhost:8000/resources/test.ogv";
-  video.addEventListener("playing", runTests);
-  video.play();
-  testVideo = true;
+  assertMsg(videoFile, "Playable video format found");
+
+  if (videoFile) {
+    if (window.testRunner) {
+      testRunner.dumpAsText();
+      testRunner.waitUntilDone();
+    }
+    video.src = videoFile;
+    video.addEventListener("playing", runTests);
+    video.play();
+    testVideo = true;
+  } else {
+    // Still run the other tests, even if the video failed.
+    runTests();
+  }
 }
 
 function runTests() {
diff --git a/third_party/WebKit/LayoutTests/http/tests/fullscreen/resources/media-file.js b/third_party/WebKit/LayoutTests/http/tests/fullscreen/resources/media-file.js
new file mode 100644
index 0000000..c80abcb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/fullscreen/resources/media-file.js
@@ -0,0 +1,72 @@
+var audioCodecs = [
+    ["audio/wav", "wav"],
+    ["audio/aac", "m4a"],
+    ["audio/ogg", "oga"]
+];
+
+var videoCodecs = [
+    ["video/mp4", "mp4"],
+    ["video/ogg", "ogv"],
+    ["video/webm","webm"]
+];
+
+function findMediaFile(tagName, name) {
+    var codecs;
+    if (tagName == "audio")
+        codecs = audioCodecs;
+    else
+        codecs = videoCodecs;
+
+    var element = document.getElementsByTagName(tagName)[0];
+    if (!element)
+        element = document.createElement(tagName);
+
+    for (var i = 0; i < codecs.length; ++i) {
+        if (element.canPlayType(codecs[i][0]))
+            return name + "." + codecs[i][1];
+    }
+
+    return "";
+}
+
+function mimeTypeForExtension(extension) {
+    for (var i = 0; i < videoCodecs.length; ++i) {
+        if (extension == videoCodecs[i][1])
+            return videoCodecs[i][0];
+    }
+    for (var i = 0; i < audioCodecs.length; ++i) {
+        if (extension == audioCodecs[i][1])
+            return audioCodecs[i][0];
+    }
+
+    return "";
+}
+
+function mimeTypeForFile(filename) {
+ var lastPeriodIndex = filename.lastIndexOf(".");
+  if (lastPeriodIndex > 0)
+    return mimeTypeForExtension(filename.substring(lastPeriodIndex + 1));
+
+  return "";
+}
+
+function setSrcByTagName(tagName, src) {
+    var elements = document.getElementsByTagName(tagName);
+    if (elements) {
+        for (var i = 0; i < elements.length; ++i)
+            elements[i].src = src;
+    }
+}
+
+function setSrcById(id, src) {
+    var element = document.getElementById(id);
+    if (element)
+        element.src = src;
+}
+
+function stripExtension(filename) {
+  var lastPeriodIndex = filename.lastIndexOf(".");
+  if (lastPeriodIndex > 0)
+    return filename.substring(0, lastPeriodIndex);
+  return filename;
+}
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/audio-seekable-contains-zero-without-ranges.html b/third_party/WebKit/LayoutTests/http/tests/media/audio-seekable-contains-zero-without-ranges.html
index 1fa45741..dc23b5d2 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/audio-seekable-contains-zero-without-ranges.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/audio-seekable-contains-zero-without-ranges.html
@@ -24,7 +24,7 @@
     t.done();
   });
 
-  var mediaFile = '../../../../media/content/silence.oga';
+  var mediaFile = findMediaFile('audio', '../../../../media/content/silence');
   var type = mimeTypeForExtension(mediaFile.split('.').pop());
 
   audio.src = 'http://127.0.0.1:8000/media/resources/load-video.php' +
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/audio-timeline-seek-outside-seekable.html b/third_party/WebKit/LayoutTests/http/tests/media/audio-timeline-seek-outside-seekable.html
index b082ff21..ee635ff 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/audio-timeline-seek-outside-seekable.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/audio-timeline-seek-outside-seekable.html
@@ -27,7 +27,7 @@
     t.done();
   });
 
-  var mediaFile = '../../../../media/content/silence.oga';
+  var mediaFile = findMediaFile('audio', '../../../../media/content/silence');
   var type = mimeTypeForExtension(mediaFile.split('.').pop());
 
   audio.src = 'http://127.0.0.1:8000/media/resources/load-video.php' +
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-delegation.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-delegation.html
index d7748920..8e79957 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-delegation.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-delegation.html
@@ -3,6 +3,7 @@
 <title>Test that gestures are delegated to child frames when the attribute is used.</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src="/media-resources/media-file.js"></script>
 <script src="resources/autoplay-test.js"></script>
 <!-- This is a cross origin iframe with a same origin child with allow="autoplay" -->
 <iframe allow="autoplay" src="http://localhost:8000/media/autoplay/resources/nested-iframe-1a.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-disabled.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-disabled.html
index f7a4a3a..2b70989 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-disabled.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-disabled.html
@@ -3,6 +3,7 @@
 <title>Test that autoplay is disabled for cross origin by default.</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src="/media-resources/media-file.js"></script>
 <script src="resources/autoplay-test.js"></script>
 <!-- This is a cross origin iframe with a same origin child with allow="autoplay" -->
 <iframe src="http://localhost:8000/media/autoplay/resources/nested-iframe-1a.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-gesture.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-gesture.html
index 883400a..5ce9123 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-gesture.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-gesture.html
@@ -3,6 +3,7 @@
 <title>Test that autoplay works on a cross origin iframe if there is a gesture in that frame.</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src="/media-resources/media-file.js"></script>
 <script src="resources/autoplay-test.js"></script>
 <!-- This is a cross origin iframe with a same origin child with allow="autoplay" -->
 <iframe allow="autoplay" src="http://localhost:8000/media/autoplay/resources/nested-iframe-1a.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-header.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-header.html
index a56351e..1007a20 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-header.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-header.html
@@ -3,6 +3,7 @@
 <title>Test that the header will override allow=autoplay.</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src="/media-resources/media-file.js"></script>
 <script src="resources/autoplay-test.js"></script>
 <!-- This is a cross origin iframe that disables autoplay with a HTTP header -->
 <iframe allow="autoplay" src="http://localhost:8000/media/autoplay/resources/nested-frame-with-header.php"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-alternating.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-alternating.html
index fd28b401..fcc5690 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-alternating.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-alternating.html
@@ -3,6 +3,7 @@
 <title>Test that autoplay works on child frames, but only if allowed.</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src="/media-resources/media-file.js"></script>
 <script src="resources/autoplay-test.js"></script>
 <!-- This is a cross origin iframe with a same origin child with no allow attribute -->
 <iframe allow="autoplay" src="http://localhost:8000/media/autoplay/resources/nested-iframe-1b.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-iframe-no-gesture.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-iframe-no-gesture.html
index e68db76..003dcbb 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-iframe-no-gesture.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-iframe-no-gesture.html
@@ -3,6 +3,7 @@
 <title>Test that autoplay is still disabled if there is no gesture, but autoplay is switched on.</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src="/media-resources/media-file.js"></script>
 <script src="resources/autoplay-test.js"></script>
 <!-- This is a cross origin iframe with a same origin child with allow="autoplay" -->
 <iframe allow="autoplay" src="http://localhost:8000/media/autoplay/resources/nested-iframe-1a.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-same-origin.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-same-origin.html
index 58b1267f..42d793dc 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-same-origin.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-feature-policy-same-origin.html
@@ -3,6 +3,7 @@
 <title>Test that gestures are delegated automatically to same origin child frames.</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src="/media-resources/media-file.js"></script>
 <script src="resources/autoplay-test.js"></script>
 <!-- This is a same origin frame with a sub origin child frame with no allow attributes -->
 <iframe src="/media/autoplay/resources/nested-iframe-1b.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/autoplay-test.js b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/autoplay-test.js
index 19dd0294..a545ce7 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/autoplay-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/autoplay-test.js
@@ -40,7 +40,7 @@
 
 function runVideoTest() {
   const video = document.createElement('video');
-  video.src = '/media-resources/content/test.ogv';
+  video.src = findMediaFile('video', '/media-resources/content/test');
   video.play().then(tearDown, tearDown);
 }
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-frame-with-header.php b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-frame-with-header.php
index fbfa916..5b6a1aa 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-frame-with-header.php
+++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-frame-with-header.php
@@ -3,5 +3,6 @@
 ?>
 <!DOCTYPE html>
 <html>
+<script src="../../../media-resources/media-file.js"></script>
 <script src="autoplay-test.js"></script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1a.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1a.html
index a9a7c842..253dda8 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1a.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1a.html
@@ -1,4 +1,5 @@
 <!DOCTYPE html>
 <html>
+<script src="../../../media-resources/media-file.js"></script>
 <script src="autoplay-test.js"></script>
 <iframe allow="autoplay" src="http://127.0.0.1:8000/media/autoplay/resources/nested-iframe-2.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1b.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1b.html
index fe16c033..db35333 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1b.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-1b.html
@@ -1,4 +1,5 @@
 <!DOCTYPE html>
 <html>
+<script src="../../../media-resources/media-file.js"></script>
 <script src="autoplay-test.js"></script>
 <iframe src="http://127.0.0.1:8000/media/autoplay/resources/nested-iframe-2.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-2.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-2.html
index 0145a8d..5b8a658 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-2.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/nested-iframe-2.html
@@ -1,4 +1,5 @@
 <!DOCTYPE html>
 <html>
+<script src="../../../media-resources/media-file.js"></script>
 <script src="autoplay-test.js"></script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay-post-navigation.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay-post-navigation.html
index 67acf70a..cfbbeb6 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay-post-navigation.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay-post-navigation.html
@@ -3,6 +3,7 @@
 <title>Test user gesture is delegated to iframes after navigation.</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
+<script src="/media-resources/media-file.js"></script>
 <script src="autoplay-test.js"></script>
 <!-- This is a cross origin iframe with a same origin child with allow="autoplay" -->
 <iframe allow="autoplay" src="http://localhost:8000/media/autoplay/resources/nested-iframe-1a.html"></iframe>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay.html b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay.html
index e0c7dea..e912cf8b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/autoplay/resources/test-autoplay.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <title>Test document user gesture autoplay policy across navigation</title>
 <script src="/js-test-resources/js-test.js"></script>
+<script src='../../../media-resources/media-file.js'></script>
 <script>
 var jsTestIsAsync = true;
 function tearDown(result) {
@@ -11,7 +12,7 @@
 
 function runVideoTest() {
   var video = document.createElement('video');
-  video.src = "/resources/test.ogv";
+  video.src = findMediaFile("video", "/resources/test");
   video.play().then(tearDown, tearDown);
 }
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-add-hide.html b/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-add-hide.html
index af8342e..ff3ec55 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-add-hide.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-add-hide.html
@@ -2,6 +2,7 @@
 <title>Test adding keywords to controlsList hides buttons</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <script src="../../media-resources/media-controls.js"></script>
 <video controls id="enabled-controls" width="500px"></video>
 <script>
@@ -26,6 +27,6 @@
     }));
   }));
 
-  v.src = '../resources/test.ogv';
+  v.src = findMediaFile('video', '../resources/test');
 }, 'Test disabling controls on the video element with all controls.');
 </script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-remove-show.html b/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-remove-show.html
index 60880ee..2244b722 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-remove-show.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/controls/controls-list-remove-show.html
@@ -2,6 +2,7 @@
 <title>Test removing keywords from controlsList shows buttons</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <script src="../../media-resources/media-controls.js"></script>
 <video controlslist="nodownload nofullscreen" id="disabled-controls" width="500px"></video>
 <script>
@@ -27,7 +28,7 @@
     }));
   }));
 
-  v.src = '../resources/test.ogv';
+  v.src = findMediaFile('video', '../resources/test');
 }, 'Test enabling controls on the video element with them enabled.');
 </script>
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source-buffer.html b/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source-buffer.html
index d9109aa..e175b8c 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source-buffer.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source-buffer.html
@@ -15,7 +15,7 @@
     checkControlsClassName(video, "phase-ready state-buffering");
   });
 
-  const mediaFile = "../../../media/" + "content/test.ogv";
+  const mediaFile = "../../../media/" + findMediaFile("video", "content/test");
   const mimeType = mimeTypeForFile(mediaFile);
   video.src = "http://127.0.0.1:8000/resources/load-and-stall.php?name="
     + mediaFile + "&mimeType=" + mimeType + "&stallAt=100000&stallFor=8";
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source.html b/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source.html
index 2751f78..947da096 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/controls/toggle-class-with-state-source.html
@@ -4,6 +4,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../../../media-resources/media-controls.js"></script>
+<script src="../../../media-resources/media-file.js"></script>
 <video controls width=400 preload=metadata></video>
 <script>
 async_test(t => {
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-correct-ordering.html b/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-correct-ordering.html
index 332cbe6f..3aa5fa3 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-correct-ordering.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-correct-ordering.html
@@ -3,6 +3,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../../../media-resources/media-controls.js"></script>
+<script src="../../../media-resources/media-file.js"></script>
 <script src="../../../media-resources/overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -12,7 +13,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "../resources/test.ogv";
+  video.src = findMediaFile("video", "../resources/test");
   video.setAttribute("width", "60");
   // Add captions
   var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-updates-appropriately.html b/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-updates-appropriately.html
index 6f6079b..8b1f18e 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-updates-appropriately.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/controls/video-controls-overflow-menu-updates-appropriately.html
@@ -3,6 +3,7 @@
 <script src='../../resources/testharness.js'></script>
 <script src='../../resources/testharnessreport.js'></script>
 <script src='../../../media-resources/media-controls.js'></script>
+<script src='../../../media-resources/media-file.js'></script>
 <script src='../../../media-resources/overflow-menu.js'></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -14,7 +15,7 @@
 
   // Set up video
   var video = document.querySelector('video');
-  video.src = '../resources/test.ogv';
+  video.src = findMediaFile('video', '../resources/test');
   video.setAttribute('width', '60');
   // Add captions
   var trackElement = document.createElement('track');
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/gc-while-network-loading.html b/third_party/WebKit/LayoutTests/http/tests/media/gc-while-network-loading.html
index 31f8b40..e34ad50 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/gc-while-network-loading.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/gc-while-network-loading.html
@@ -8,7 +8,7 @@
 {
     var v = document.createElement("video");
     v.foo = "bar";
-    var mediaFile = "../../../media/content/test.ogv";
+    var mediaFile = findMediaFile("video", "../../../media/content/test");
     var type = mimeTypeForExtension(mediaFile.split(".").pop());
     v.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + mediaFile + "&throttle=50&type=" + type;
     v.onloadstart = t.step_func(function()
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-document.html b/third_party/WebKit/LayoutTests/http/tests/media/media-document.html
index 4802aa12..e29eac4 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-document.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-document.html
@@ -6,7 +6,7 @@
 <body>
 <script>
 async_test(function(t) {
-    var movie = 'test.ogv';
+    var movie = findMediaFile('video', 'test');
     var type = mimeTypeForExtension(movie.split('.').pop());
     var iframe = document.createElement('iframe');
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer-expected.txt
new file mode 100644
index 0000000..dbcd6b5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer-expected.txt
@@ -0,0 +1,16 @@
+CONSOLE WARNING: line 16: Ignore this warning. See https://crbug.com/568704#c2
+This is a testharness.js-based test.
+PASS Test addSourceBuffer() in 'ended' state.
+PASS Test addSourceBuffer() with empty type
+PASS Test addSourceBuffer() with null
+PASS Test addSourceBuffer() with unsupported type
+PASS Test addSourceBuffer() with Vorbis and VP8
+PASS Test addSourceBuffer() with Vorbis and VP8 in separate SourceBuffers
+PASS Test addSourceBuffer() video only
+PASS Test addSourceBuffer() audio only
+FAIL Test addSourceBuffer() with AAC and H.264 assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported expected true got false
+FAIL Test addSourceBuffer() with AAC and H.264 in separate SourceBuffers assert_true: video/mp4;codecs="avc1.4D4001" is supported expected true got false
+PASS Test addSourceBuffer() throws QuotaExceededError after MediaSource has completed init.
+PASS Test addSourceBuffer() succeeds while incomplete init segment is appended, fails after MediaSource init completed.
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt
index a07603d..fa56a24 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt
@@ -1,5 +1,4 @@
-CONSOLE WARNING: line 106: Ignore this warning. See https://crbug.com/568704#c2
 This is a testharness.js-based test.
-PASS Tests mp4 audio-only bitrate changes.
+FAIL Tests mp4 audio-only bitrate changes. assert_true: audio/mp4;codecs="mp4a.40.2" is supported. expected true got false
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt
index 48ad7c5..2b7793b3 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt
@@ -1,5 +1,4 @@
-CONSOLE WARNING: line 106: Ignore this warning. See https://crbug.com/568704#c2
 This is a testharness.js-based test.
-PASS Tests mp4 audio bitrate changes in multiplexed content.
+FAIL Tests mp4 audio bitrate changes in multiplexed content. assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported. expected true got false
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-framesize-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-framesize-expected.txt
index 272d3aa..3e82c6e 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-framesize-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-framesize-expected.txt
@@ -1,5 +1,4 @@
-CONSOLE WARNING: line 106: Ignore this warning. See https://crbug.com/568704#c2
 This is a testharness.js-based test.
-PASS Tests mp4 frame size changes in multiplexed content.
+FAIL Tests mp4 frame size changes in multiplexed content. assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported. expected true got false
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt
index 536d6ac..8efe81a 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt
@@ -1,5 +1,4 @@
-CONSOLE WARNING: line 106: Ignore this warning. See https://crbug.com/568704#c2
 This is a testharness.js-based test.
-PASS Tests mp4 video bitrate changes in multiplexed content.
+FAIL Tests mp4 video bitrate changes in multiplexed content. assert_true: video/mp4;codecs="avc1.4D4001,mp4a.40.2" is supported. expected true got false
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt
index 700eeed..8f53878c6 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt
@@ -1,5 +1,4 @@
-CONSOLE WARNING: line 106: Ignore this warning. See https://crbug.com/568704#c2
 This is a testharness.js-based test.
-PASS Tests mp4 video-only bitrate changes.
+FAIL Tests mp4 video-only bitrate changes. assert_true: video/mp4;codecs="avc1.4D4001" is supported. expected true got false
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framerate-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framerate-expected.txt
index f22b5e1..61e3e73 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framerate-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framerate-expected.txt
@@ -1,5 +1,4 @@
-CONSOLE WARNING: line 106: Ignore this warning. See https://crbug.com/568704#c2
 This is a testharness.js-based test.
-PASS Tests mp4 video-only frame rate changes.
+FAIL Tests mp4 video-only frame rate changes. assert_true: video/mp4;codecs="avc1.4D4001" is supported. expected true got false
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framesize-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framesize-expected.txt
index be280a98..9f613a78 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framesize-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-config-change-mp4-v-framesize-expected.txt
@@ -1,5 +1,4 @@
-CONSOLE WARNING: line 106: Ignore this warning. See https://crbug.com/568704#c2
 This is a testharness.js-based test.
-PASS Tests mp4 video-only frame size changes.
+FAIL Tests mp4 video-only frame size changes. assert_true: video/mp4;codecs="avc1.4D4001" is supported. expected true got false
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-is-type-supported-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-is-type-supported-expected.txt
index 143b4d2a..35e804b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-is-type-supported-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-is-type-supported-expected.txt
@@ -30,14 +30,14 @@
 PASS Test valid WebM type "video/webm;codecs="vorbis, vp8""
 PASS Test valid WebM type "audio/webm;codecs="vorbis""
 PASS Test valid WebM type "AUDIO/WEBM;CODECS="vorbis""
-PASS Test valid MP4 type "video/mp4;codecs="avc1.4d001e""
-PASS Test valid MP4 type "video/mp4;codecs="avc1.42001e""
-PASS Test valid MP4 type "audio/mp4;codecs="mp4a.40.2""
-PASS Test valid MP4 type "audio/mp4;codecs="mp4a.40.5""
-PASS Test valid MP4 type "audio/mp4;codecs="mp4a.67""
-PASS Test valid MP4 type "video/mp4;codecs="mp4a.40.2""
-PASS Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.2""
-PASS Test valid MP4 type "video/mp4;codecs="mp4a.40.2 , avc1.4d001e ""
-PASS Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.5""
+FAIL Test valid MP4 type "video/mp4;codecs="avc1.4d001e"" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "video/mp4;codecs="avc1.42001e"" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "audio/mp4;codecs="mp4a.40.2"" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "audio/mp4;codecs="mp4a.40.5"" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "audio/mp4;codecs="mp4a.67"" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "video/mp4;codecs="mp4a.40.2"" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.2"" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "video/mp4;codecs="mp4a.40.2 , avc1.4d001e "" assert_equals: supported expected true but got false
+FAIL Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.5"" assert_equals: supported expected true but got false
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/mixed-range-response.html b/third_party/WebKit/LayoutTests/http/tests/media/mixed-range-response.html
index 637f37c..f3a8c88 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/mixed-range-response.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/mixed-range-response.html
@@ -2,6 +2,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="../resources/get-host-info.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <body>
 <script>
 // This file tests the following behavior:
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/pdf-served-as-pdf.html b/third_party/WebKit/LayoutTests/http/tests/media/pdf-served-as-pdf.html
index 99e3a31..7623ca0 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/pdf-served-as-pdf.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/pdf-served-as-pdf.html
@@ -2,6 +2,7 @@
 <title>Tests that a PDF file is served as "application/pdf"</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/preload-conditions.html b/third_party/WebKit/LayoutTests/http/tests/media/preload-conditions.html
index 362959fb..29f9182 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/preload-conditions.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/preload-conditions.html
@@ -2,6 +2,7 @@
 <title>Test media preloading behaviour with different conditions.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <script>
 var tests = [
   {
@@ -134,7 +135,7 @@
   [ '', 'none', 'metadata', 'auto' ].forEach(preload => {
     var media = document.createElement('video');
     media.preload = preload;
-    media.src = 'resources/test.ogv';
+    media.src = findMediaFile('video', 'resources/test');
     assert_equals(media.readyState, HTMLMediaElement.HAVE_NOTHING);
 
     switch (media.preload) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/progress-events-generated-correctly.html b/third_party/WebKit/LayoutTests/http/tests/media/progress-events-generated-correctly.html
index 93299e9..a9147c2 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/progress-events-generated-correctly.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/progress-events-generated-correctly.html
@@ -68,7 +68,7 @@
         setTimeout(t.step_func(checkProgressCount), maxProgressFiringIntervalInMS);
     });
 
-    var mediaFile = 'resources/test.ogv';
+    var mediaFile = findMediaFile('video', 'resources/test');
     var mimeType = mimeTypeForFile(mediaFile);
     // Assumes minimum file size selected is > 100 kB.
     // At least 4*maxProgressFiringIntervalInMS is how long we want to stretch the full
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/reload-after-dialog.html b/third_party/WebKit/LayoutTests/http/tests/media/reload-after-dialog.html
index 285952a..c6518f1 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/reload-after-dialog.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/reload-after-dialog.html
@@ -2,6 +2,7 @@
 <title>Test that video is not reloaded on showing a dialog.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <video></video>
 <script>
 // Make sure we don't reload a "video" element after a dialog is shown.
@@ -9,7 +10,7 @@
 // "loadstart" event handler is called. If the movie is reloaded when
 // the dialog is "dismissed", another "loadstart" event will be fired.
 async_test(function(t) {
-    var movie = "../resources/test.ogv";
+    var movie = findMediaFile("video", "../resources/test");
     var video = document.querySelector("video");
 
     video.onloadstart = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html b/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html
index b70643c..d990655 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html
@@ -13,7 +13,7 @@
         setTimeout(t.step_func_done(), 100);
     });
 
-    var mediaFile = "content/test.ogv";
+    var mediaFile = findMediaFile("video", "content/test");
     var mimeType = mimeTypeForFile(mediaFile);
     video.src = "http://127.0.0.1:8000/resources/load-and-stall.php?name=../../../media/" + mediaFile + "&mimeType=" + mimeType + "&stallAt=100000";
 });
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/resources/autoplay-crossorigin-iframe.html b/third_party/WebKit/LayoutTests/http/tests/media/resources/autoplay-crossorigin-iframe.html
index 1e99cfe..27797563 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/resources/autoplay-crossorigin-iframe.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/resources/autoplay-crossorigin-iframe.html
@@ -1,4 +1,5 @@
 <!DOCTYPE html>
+<script src="../../../media-resources/media-file.js"></script>
 <body></body>
 <script>
 window.internals.settings.setAutoplayPolicy('user-gesture-required-for-cross-origin');
@@ -7,7 +8,7 @@
 {
   var video = document.createElement('video');
   video.id = 'video';
-  video.src = 'test.ogv';
+  video.src = findMediaFile('video', 'test');
   video.autoplay = true;
   video.loop = true;
   document.body.appendChild(video);
@@ -16,7 +17,7 @@
 {
   var video = document.createElement('video');
   video.id = 'video-muted';
-  video.src = 'test.ogv';
+  video.src = findMediaFile('video', 'test');
   video.muted = true;
   video.autoplay = true;
   video.loop = true;
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html b/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html
index 5263da1..9631716 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html
@@ -2,6 +2,7 @@
 <title>Tests that a text file is served as "text/plain".</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html b/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html
index 8bbcd66..862c90a3 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html
@@ -23,7 +23,7 @@
     video.currentTime = video.duration - 0.5;
 };
 
-var mediaFile = "../../../media/content/test.oga";
+var mediaFile = findMediaFile("audio", "../../../media/content/test");
 var type = mimeTypeForExtension(mediaFile.split(".").pop());
 video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + mediaFile + "&throttle=5000&nph=1&type=" + type;
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html b/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html
index a3528ae..70dd2fa 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Cancel loading a video file and access its properties afterwards.</title>
+<script src="../../media-resources/media-file.js"></script>
 <video></video>
 
 <textarea style="display: none;">
@@ -34,7 +35,7 @@
     doc.close();
 };
 
-var file = "../resources/test.ogv";
+var file = findMediaFile("video", "../resources/test");
 video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?throttle=40&name=" + file;
 
 // Change URL of the current page to a blank page.
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-displayed.html b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-displayed.html
index 38ff5737..20409084 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-displayed.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-displayed.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="../../media-resources/media-controls.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <!--Padding ensures the overflow menu is visible for the tests. -->
 <body style="padding-top: 200px; padding-left: 100px">
 <video controls></video>
@@ -10,7 +11,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "resources/test.ogv";
+  video.src = findMediaFile("video", "resources/test");
   var controlID = "-internal-media-controls-download-button";
   var downloadButton = mediaControlsElement(internals.shadowRoot(video).firstChild, controlID);
   video.onloadeddata = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-not-displayed-hide-download-ui.html b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-not-displayed-hide-download-ui.html
index 2c7c356abd..cc20b092 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-not-displayed-hide-download-ui.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-not-displayed-hide-download-ui.html
@@ -3,12 +3,13 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="../../media-resources/media-controls.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <video controls></video>
 <script>
 async_test(function(t) {
   window.internals.settings.setHideDownloadUI(true);
   var video = document.querySelector("video");
-  video.src = "resources/test.ogv";
+  video.src = findMediaFile("video", "resources/test");
   var controlID = "-internal-media-controls-download-button";
   var downloadButton = mediaControlsElement(internals.shadowRoot(video).firstChild, controlID);
   video.onloadeddata = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media-cross-origin.html b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media-cross-origin.html
index 0b11f670..cc88f698 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media-cross-origin.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media-cross-origin.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="../../media-resources/media-controls.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <script src="../../media-resources/overflow-menu.js"></script>
 <!--Padding ensures the overflow menu is visible for the tests. -->
 <body style="padding-top: 200px; padding-left: 100px">
@@ -16,7 +17,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "http://localhost:8000/media/resources/test.ogv";
+  video.src = findMediaFile("video", "http://localhost:8000/media/resources/test");
   var controlID = "-internal-media-controls-download-button";
   var downloadButton = mediaControlsElement(internals.shadowRoot(video).firstChild, controlID);
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media.html b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media.html
index fa9bb78..480d859 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-download-button-saves-media.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="../../media-resources/media-controls.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <script src="../../media-resources/overflow-menu.js"></script>
 <!--Padding ensures the overflow menu is visible for the tests. -->
 <body style="padding-top: 200px; padding-left: 100px">
@@ -16,7 +17,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "resources/test.ogv";
+  video.src = findMediaFile("video", "resources/test");
   var controlID = "-internal-media-controls-download-button";
   var downloadButton = mediaControlsElement(internals.shadowRoot(video).firstChild, controlID);
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-overflow-menu-download-button.html b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-overflow-menu-download-button.html
index 7badd4f..1fa9599 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-overflow-menu-download-button.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-overflow-menu-download-button.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="../../media-resources/media-controls.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <script src="../../media-resources/overflow-menu.js"></script>
 <!--Padding ensures the overflow menu is visible for the tests. -->
 <body style="padding-top: 200px; padding-left: 100px">
@@ -14,7 +15,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "resources/test.ogv";
+  video.src = findMediaFile("video", "resources/test");
   video.setAttribute("width", "60");
 
   var controlID = "-internal-media-controls-download-button";
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html b/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html
index a32ed19..7478c13 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html
@@ -2,11 +2,12 @@
 <title>Tests that the media player will send the relevant cookies when requesting the media file.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <body>
 <video></video>
 <script>
 async_test(function(t) {
-    var movie = "resources/test.ogv";
+    var movie = findMediaFile("video", "resources/test");
     var frame = document.createElement("iframe");
     document.body.appendChild(frame);
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-error-abort.html b/third_party/WebKit/LayoutTests/http/tests/media/video-error-abort.html
index 0117958..e1284898 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-error-abort.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-error-abort.html
@@ -2,6 +2,7 @@
 <title>Test "abort" event.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -25,7 +26,7 @@
         assert_equals(video.error, null);
     }));
 
-    var movie = "../resources/test.ogv";
+    var movie = findMediaFile("video", "../resources/test");
     video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + movie + "&throttle=256";
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html b/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html
index 3d6896355..cd3f0200 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html
@@ -12,7 +12,7 @@
     watcher.wait_for(["loadedmetadata", "error"]).then(t.step_func_done(function() {
         assert_equals(video.networkState, HTMLMediaElement.NETWORK_IDLE);
     }));
-    var movie = "resources/test.ogv";
+    var movie = findMediaFile("video", "resources/test");
     var type = mimeTypeForExtension(movie.split(".").pop());
     video.src = "video-load-metadata-decode-error.cgi?name=" + movie + "&type=" + type;
     video.play();
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-load-suspend.html b/third_party/WebKit/LayoutTests/http/tests/media/video-load-suspend.html
index 831e76a5..71a7186 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-load-suspend.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-load-suspend.html
@@ -2,11 +2,12 @@
 <title>Test that the load eventually suspends and returns to NETWORK_IDLE.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "http://127.0.0.1:8000/resources/test.ogv";
+    video.src = findMediaFile("video", "http://127.0.0.1:8000/resources/test");
     var watcher = new EventWatcher(t, video, ["loadstart", "suspend"]);
     watcher.wait_for(["loadstart", "suspend"]).then(t.step_func_done(function() {
         assert_equals(video.networkState, HTMLMediaElement.NETWORK_IDLE);
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-load-twice.html b/third_party/WebKit/LayoutTests/http/tests/media/video-load-twice.html
index 1425414..f89f1bd 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-load-twice.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-load-twice.html
@@ -2,10 +2,11 @@
 <title>Test loading video twice.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <body>
 <script>
 async_test(function(t) {
-    var file = "http://127.0.0.1:8000/resources/test.ogv";
+    var file = findMediaFile("video", "http://127.0.0.1:8000/resources/test");
     createAndLoadVideo(false);
     function createAndLoadVideo(endTest) {
         var video = document.createElement("video");
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html b/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html
index e586a2f..34bac02 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html
@@ -15,7 +15,7 @@
         video.onerror = t.unreached_func();
         video.oncanplay = t.step_func_done();
 
-        var movie = 'test.ogv';
+        var movie = findMediaFile('video', 'test');
         var type = mimeTypeForExtension(movie.split('.').pop());
         source = document.querySelector('source');
         source.type = type;
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html b/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html
index fea4ef3..68cedea 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html
@@ -2,6 +2,7 @@
 <title>Test that at least one progress event is fired after starting to load the video.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -10,7 +11,7 @@
     var watcher = new EventWatcher(t, video, ["loadstart", "progress"]);
     watcher.wait_for(["loadstart", "progress"]).then(t.step_func_done());
 
-    var mediaFile = "resources/test.ogv";
+    var mediaFile = findMediaFile("video", "resources/test");
     video.src = "http://127.0.0.1:8000/" + mediaFile;
     video.play();
   });
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html
index 879e522..f1363f3 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html
@@ -16,7 +16,7 @@
     }));
 
     // Find a supported media file.
-    var mediaFile = "content/test.ogv";
+    var mediaFile = findMediaFile("video", "content/test");
     var mimeType = mimeTypeForFile(mediaFile);
 
     // Load should stall very early in the loading process.
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html
index 91424e4..d445f59 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html
@@ -126,7 +126,7 @@
 
 
     // Find a supported media file.
-    var mediaFile = "content/test.ogv";
+    var mediaFile = findMediaFile("video", "content/test");
     var mimeType = mimeTypeForFile(mediaFile);
     // URL will load part of the file, pause for 8 seconds, then load the rest.
     // The delay of 8 seconds is chosen to reduce flakiness in waiting for the
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-preload-metadata.html b/third_party/WebKit/LayoutTests/http/tests/media/video-preload-metadata.html
index d7558405..d4a7cdfd 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-preload-metadata.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-preload-metadata.html
@@ -2,6 +2,7 @@
 <title>Verifies preload=metadata doesn't buffer the entire clip.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <div id="log"></div>
 <video controls preload=metadata></video>
 <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html b/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html
index c1dd2d7..e4255a4 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html
@@ -10,7 +10,7 @@
     var iframe = document.createElement('iframe');
 
     iframe.onload = t.step_func(function() {
-        var movie = 'test.ogv';
+        var movie = findMediaFile('video', 'test');
         var type = mimeTypeForExtension(movie.split('.').pop());
         var video = document.querySelector('video');
         video.onerror = t.unreached_func();
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-referer.html b/third_party/WebKit/LayoutTests/http/tests/media/video-referer.html
index 113433a29..2949aca 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-referer.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-referer.html
@@ -9,7 +9,7 @@
 </video>
 <script>
 async_test(function(t) {
-    var movie = 'test.ogv';
+    var movie = findMediaFile('video', 'test');
     var type = mimeTypeForExtension(movie.split('.').pop());
     var iframe = document.createElement('iframe');
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-duration.html b/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-duration.html
index fd82e9c..ba61b9c7 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-duration.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-duration.html
@@ -2,6 +2,7 @@
 <title>Test event dispatches and attribute changes for seek to duration.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -47,7 +48,7 @@
         assert_equals(video.currentTime, video.duration);
     }
 
-    video.src = "resources/test.ogv";;
+    video.src = findMediaFile("video", "resources/test");;
     video.play();
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-middle.html b/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-middle.html
index 33bdae3..759e784e 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-middle.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-middle.html
@@ -2,6 +2,7 @@
 <title>Test event dispatches and attribute changes for seek to middle.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -45,7 +46,7 @@
         assert_false(video.paused);
     }
 
-    video.src = "resources/test.ogv";
+    video.src = findMediaFile("video", "resources/test");
     video.play();
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html b/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html
index 85cac6db..9fc3e16 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html
@@ -2,6 +2,7 @@
 <title>Tests that a media file is served as "text/plain".</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -11,7 +12,7 @@
     watcher.wait_for(["loadstart", "loadedmetadata"]).then(t.step_func_done());
     assert_equals(video.error, null);
 
-    var movie = "resources/test.ogv";
+    var movie = findMediaFile("video", "resources/test");
     video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + movie + "&throttle=99999&type=text/plain";
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-useragent.html b/third_party/WebKit/LayoutTests/http/tests/media/video-useragent.html
index 293b4c2..1197a820 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-useragent.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-useragent.html
@@ -9,7 +9,7 @@
 </video>
 <script>
 async_test(function(t) {
-    var movie = 'test.ogv';
+    var movie = findMediaFile('video', 'test');
     var type = mimeTypeForExtension(movie.split('.').pop());
     var iframe = document.createElement('iframe');
 
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote-expected.txt
index 2e81681..91b0c1dc 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: Not allowed to load local resource: test.ogv
+CONSOLE ERROR: Not allowed to load local resource: test.mp4
 Test that a remote video element will not use a local <source>, and will use another remote <source>
 
 This test only behaves correctly in DRT
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote.html b/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote.html
index 19fcd84..ed531c3 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/local-video-source-from-remote.html
@@ -14,13 +14,13 @@
                 consoleWrite("<br>END OF TEST");
                 testEnded = true;
                 if (window.testRunner)
-                    testRunner.notifyDone();
+                    testRunner.notifyDone();     
             }
             function hanged()
             {
                 consoleWrite("FAIL: timed out");
                 if (window.testRunner)
-                    testRunner.notifyDone();
+                    testRunner.notifyDone();  
             }
 
             function logConsole()
@@ -31,7 +31,7 @@
                 }
                 return console;
             }
-
+            
             function consoleWrite(text)
             {
                 if (testEnded)
@@ -60,25 +60,24 @@
                 endTest();
             }
 
-            var localMovie = "file:///tmp/LayoutTests/media/content/test.ogv";
-            var remoteUrl = "http://localhost:8000/resources/test.ogv";
+            var localMovie = "file:///tmp/LayoutTests/media/content/test.mp4";
+            var remoteUrl = "http://localhost:8000/resources/test";
 
-            function loadedmetadata(evt)
-            {
+            function loadedmetadata(evt) 
+            { 
                 var src = video.currentSrc;
+                var localFile = localMovie.substring(localMovie.lastIndexOf("/")+1, localMovie.length)
+                var remoteFile = remoteUrl.substring(remoteUrl.lastIndexOf("/")+1, remoteUrl.length)
 
                 logEvent(evt);
-                if (src == localMovie)
+                if (src.indexOf(localFile) > 0)
                     logResult("local movie loaded", false);
-                else if (src == remoteUrl)
+                else if (src.indexOf(remoteFile) > 0)
                     logResult("remote movie loaded, local movie failed to load", true);
-                else
-                    logResult("video failed to load any movie", false);
-
                 endTest();
             }
 
-            if (window.testRunner)
+            if (window.testRunner) 
             {
                 localMovie = testRunner.pathToLocalResource(localMovie);
                 testRunner.dumpAsText();
@@ -86,7 +85,7 @@
             }
             setTimeout(hanged, 10000);
 
-            function test()
+            function test() 
             {
                 video = document.getElementById("vid");
 
@@ -98,6 +97,15 @@
                 var src1 = document.createElement("source");
                 src1.setAttribute("src", localMovie);
 
+                if (video.canPlayType("video/mp4"))
+                    remoteUrl += ".mp4";
+                else if (video.canPlayType("video/ogg"))
+                    remoteUrl += ".ogv";
+                else {
+                    logResult("Missing test movie for this platform???", false);
+                    endTest();
+                }
+
                 var src2 = document.createElement("source");
                 src2.setAttribute("src", remoteUrl);
 
@@ -105,7 +113,7 @@
                 video.appendChild(src2);
             }
         </script>
-
+    
     </head>
 
     <body onLoad="test()">
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-readback.html b/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-readback.html
index e303246..5809bbce 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-readback.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-readback.html
@@ -7,7 +7,7 @@
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    var mediaFile = "../../media/resources/test.ogv";
+    var mediaFile = findMediaFile("video", "../../media/resources/test");
     var type = mimeTypeForExtension(mediaFile.split('.').pop());
 
     video.onerror = t.unreached_func();
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-via-dom.html b/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-via-dom.html
index 7a692cf7..4b1cbc9e 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-via-dom.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-via-dom.html
@@ -16,7 +16,7 @@
     });
 
     document.body.appendChild(video);
-    var mediaFile = "../../media/resources/test.ogv";
+    var mediaFile = findMediaFile("video", "../../media/resources/test");
     var type = mimeTypeForExtension(mediaFile.split('.').pop());
     video.src = "http://localhost:8080/security/resources/video-cross-origin-allow.php?no-preflight&name=" + mediaFile + "&type=" + type;
     video.play();
diff --git a/third_party/WebKit/LayoutTests/media/W3C/audio/canPlayType/canPlayType_supported_but_no_codecs_parameter_2-expected.txt b/third_party/WebKit/LayoutTests/media/W3C/audio/canPlayType/canPlayType_supported_but_no_codecs_parameter_2-expected.txt
index c10c22c2..045897d 100644
--- a/third_party/WebKit/LayoutTests/media/W3C/audio/canPlayType/canPlayType_supported_but_no_codecs_parameter_2-expected.txt
+++ b/third_party/WebKit/LayoutTests/media/W3C/audio/canPlayType/canPlayType_supported_but_no_codecs_parameter_2-expected.txt
@@ -3,7 +3,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS "maybe" is "maybe"
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3-expected.txt b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3-expected.txt
index 6dd503b..d9e6648 100644
--- a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3-expected.txt
+++ b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3-expected.txt
@@ -4,7 +4,6 @@
 
 
 PASS "" is ""
-PASS "probably" is "probably"
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3.html b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3.html
index ecd3f46d..b80b1e98 100644
--- a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3.html
+++ b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_codecs_order_3.html
@@ -13,13 +13,8 @@
 test(function() {
  var v = document.getElementById("v");
   assert_equals(
-   v.canPlayType('video/webm; codecs="vp8, BOGUS"'),
-   v.canPlayType('video/webm; codecs="BOGUS, vp8"'),
-   "order of codecs parameters should have no effect");
-
-  assert_equals(
-   v.canPlayType('video/webm; codecs="vp8, opus"'),
-   v.canPlayType('video/webm; codecs="opus, vp8"'),
+   v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'),
+   v.canPlayType('video/mp4; codecs="mp4a.40.2, avc1.42E01E"'),
    "order of codecs parameters should have no effect");
 });
   </script>
diff --git a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_supported_but_no_codecs_parameter_3-expected.txt b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_supported_but_no_codecs_parameter_3-expected.txt
index f4c736f..0c1ece3e 100644
--- a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_supported_but_no_codecs_parameter_3-expected.txt
+++ b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_supported_but_no_codecs_parameter_3-expected.txt
@@ -3,7 +3,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS "maybe" is "maybe"
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5-expected.txt b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5-expected.txt
index aea6276f..ba70851 100644
--- a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5-expected.txt
+++ b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5-expected.txt
@@ -3,7 +3,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS "probably" is "probably"
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5.html b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5.html
index d2cac6e5..85afb61f 100644
--- a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5.html
+++ b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_5.html
@@ -15,7 +15,7 @@
  if (v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"') == "probably") {
   assert_equals(
    v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'),
-   v.canPlayType('video/mp4; codecs="avc1.42E01E"'),
+   v.canPlayType('video/ogg; codecs="avc1.42E01E"'),
    "ability to play two codecs implies the ability to play one");
  }
 });
diff --git a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6-expected.txt b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6-expected.txt
index aea6276f..ba70851 100644
--- a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6-expected.txt
+++ b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6-expected.txt
@@ -3,7 +3,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS "probably" is "probably"
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6.html b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6.html
index 3d4a59dc..2b615f1 100644
--- a/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6.html
+++ b/third_party/WebKit/LayoutTests/media/W3C/video/canPlayType/canPlayType_two_implies_one_6.html
@@ -15,7 +15,7 @@
  if (v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"') == "probably") {
   assert_equals(
    v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'),
-   v.canPlayType('video/mp4; codecs="mp4a.40.2"'),
+   v.canPlayType('video/ogg; codecs="mp4a.40.2"'),
    "ability to play two codecs implies the ability to play one");
  }
 });
diff --git a/third_party/WebKit/LayoutTests/media/adopt-node-crash.html b/third_party/WebKit/LayoutTests/media/adopt-node-crash.html
index c9bc0ede..1a02439 100644
--- a/third_party/WebKit/LayoutTests/media/adopt-node-crash.html
+++ b/third_party/WebKit/LayoutTests/media/adopt-node-crash.html
@@ -50,7 +50,7 @@
             {
                 var video = document.getElementsByTagName('video')[0];
                 video.addEventListener("loadstart", loadstart);
-                video.src = "content/test.ogv";
+                video.src = findMediaFile("video", "content/test");
             }
         </script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/media/audio-concurrent-supported.html b/third_party/WebKit/LayoutTests/media/audio-concurrent-supported.html
index e41b2ec..ecffca8 100644
--- a/third_party/WebKit/LayoutTests/media/audio-concurrent-supported.html
+++ b/third_party/WebKit/LayoutTests/media/audio-concurrent-supported.html
@@ -2,6 +2,7 @@
 <title>Test that multiple audio elements can play concurrently.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
 async_test(function(t) {
     // Number of concurrent audio elements to test.
@@ -45,7 +46,7 @@
             }
         });
 
-        audioElement.src = "content/silence.oga";
+        audioElement.src = findMediaFile("audio", "content/silence");
     }
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/audio-constructor-preload.html b/third_party/WebKit/LayoutTests/media/audio-constructor-preload.html
index 6dfbbb6..ae635c7 100644
--- a/third_party/WebKit/LayoutTests/media/audio-constructor-preload.html
+++ b/third_party/WebKit/LayoutTests/media/audio-constructor-preload.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that Audio() sets "preload" attribute.</title>
+<script src="media-file.js"></script>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script>
@@ -15,7 +16,7 @@
         assert_equals(audio.preload, "auto");
     });
 
-    audio.src = "content/test.oga";
+    audio.src = findMediaFile("audio", "content/test");
     audio.load();
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/audio-constructor-src.html b/third_party/WebKit/LayoutTests/media/audio-constructor-src.html
index c30a1036..0cebeb8 100644
--- a/third_party/WebKit/LayoutTests/media/audio-constructor-src.html
+++ b/third_party/WebKit/LayoutTests/media/audio-constructor-src.html
@@ -1,10 +1,11 @@
 <!DOCTYPE html>
 <title>Test that Audio("url") constructor loads the specified resource.</title>
+<script src="media-file.js"></script>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script>
 async_test(function(t) {
-    var audioFile = "content/test.oga";
+    var audioFile = findMediaFile("audio", "content/test");
     var audio = new Audio(audioFile);
 
     audio.onloadstart = t.step_func(function () {
diff --git a/third_party/WebKit/LayoutTests/media/audio-constructor.html b/third_party/WebKit/LayoutTests/media/audio-constructor.html
index de7d252..dadaf589 100644
--- a/third_party/WebKit/LayoutTests/media/audio-constructor.html
+++ b/third_party/WebKit/LayoutTests/media/audio-constructor.html
@@ -1,12 +1,13 @@
 <!DOCTYPE html>
 <title>Test that Audio() object loads the resource after src attribute is set and load() is called.</title>
+<script src="media-file.js"></script>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script>
 async_test(function(t) {
     var audio = new Audio();
 
-    var audioFile = "content/test.oga";
+    var audioFile = findMediaFile("audio", "content/test");
     audio.src = audioFile;
     audio.onloadstart = t.step_func(function () {
         var url = audio.currentSrc;
diff --git a/third_party/WebKit/LayoutTests/media/audio-controls-captions.html b/third_party/WebKit/LayoutTests/media/audio-controls-captions.html
index 70b1714..cdfd5e3 100644
--- a/third_party/WebKit/LayoutTests/media/audio-controls-captions.html
+++ b/third_party/WebKit/LayoutTests/media/audio-controls-captions.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Tests that the closed captions button is not visible.</title>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
@@ -9,7 +10,7 @@
 <script>
 async_test(function(t) {
     var audio = document.querySelector('audio');
-    audio.src = 'content/test.oga';
+    audio.src = findMediaFile('audio', 'content/test');
     audio.onloadedmetadata = t.step_func_done(function() {
         assert_false(isClosedCaptionsButtonVisible(audio));
     });
diff --git a/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html b/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html
index b35f37c..920ae6792 100644
--- a/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html
+++ b/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>This tests that audio controls do not fade out when the audio is playing.</title>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
@@ -7,7 +8,7 @@
 <script>
 async_test(function(t) {
     var audio = document.querySelector("audio");
-    audio.src = "content/test.oga";
+    audio.src = findMediaFile("audio", "content/test");
     audio.onplaying = t.step_func(function() {
         runAfterHideMediaControlsTimerFired(t.step_func_done(controlsTimerFired), audio);
     });
diff --git a/third_party/WebKit/LayoutTests/media/audio-controls-rendering.html b/third_party/WebKit/LayoutTests/media/audio-controls-rendering.html
index 997a5612..19636d3d 100644
--- a/third_party/WebKit/LayoutTests/media/audio-controls-rendering.html
+++ b/third_party/WebKit/LayoutTests/media/audio-controls-rendering.html
@@ -1,18 +1,18 @@
 <html>
     <head>
         <style>
-            audio { background-color: blue; }
+            audio { background-color: blue; } 
         </style>
         <script src=media-file.js></script>
         <script>
             function test()
             {
-                setSrcByTagName("audio", "content/test.oga");
+                setSrcByTagName("audio", findMediaFile("audio", "content/test"));
 
                 if (window.testRunner) {
                     testRunner.waitUntilDone();
-                    setTimeout(function() {
-                        document.body.appendChild(document.createTextNode('FAIL'));
+                    setTimeout(function() { 
+                        document.body.appendChild(document.createTextNode('FAIL')); 
                         if (window.testRunner)
                                 testRunner.notifyDone();
                     } , 8000);
diff --git a/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html b/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html
index 2f69e86..3f8a1f8 100644
--- a/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html
+++ b/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>This tests that events don't continue to target a slider thumb if the media element is deleted while scrubbing.</title>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
@@ -8,7 +9,7 @@
 <script>
 async_test(function(t) {
     var audio = document.querySelector("audio");
-    audio.src = "content/test.oga";
+    audio.src = findMediaFile("audio", "content/test");
     audio.onplaying = t.step_func(function() {
         var seekCoords = mediaControlsButtonCoordinates(audio, "timeline");
         var x = seekCoords[0];
diff --git a/third_party/WebKit/LayoutTests/media/audio-garbage-collect.html b/third_party/WebKit/LayoutTests/media/audio-garbage-collect.html
index 59b1db4..148cbd2 100644
--- a/third_party/WebKit/LayoutTests/media/audio-garbage-collect.html
+++ b/third_party/WebKit/LayoutTests/media/audio-garbage-collect.html
@@ -1,5 +1,6 @@
 <!DOCTYPE HTML>
 <title>Tests that we don't garbage collect audio object while it is still playing.</title>
+<script src="media-file.js"></script>
 <script src="../resources/gc.js"></script>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
@@ -14,9 +15,9 @@
 async_test(function(t) {
     var audioPlayers = 4;
     var playedCount = 0;
-    var audioFile = "content/silence.oga";
+    var audioFile = findMediaFile("audio", "content/silence");
     var audio = new Audio(audioFile);
-
+    
     audio.onended = t.step_func(function() {
         playedCount ++;
         if (playedCount <= audioPlayers) {
diff --git a/third_party/WebKit/LayoutTests/media/audio-play-event.html b/third_party/WebKit/LayoutTests/media/audio-play-event.html
index f940518..906651c 100644
--- a/third_party/WebKit/LayoutTests/media/audio-play-event.html
+++ b/third_party/WebKit/LayoutTests/media/audio-play-event.html
@@ -1,5 +1,6 @@
 <!DOCTYPE HTML>
 <title>Test that a 'play' event is fired by a new audio element on playing.</title>
+<script src="media-file.js"></script>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script>
@@ -10,7 +11,7 @@
     audio.oncanplay = t.step_func(function() {});
     audio.onplaying = t.step_func_done();
     audio.onerror = t.unreached_func("Should not fire 'error' event");
-    audio.src = "content/test.oga";
+    audio.src = findMediaFile("audio", "content/test");
     audio.play();
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts.html b/third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts.html
index 624eafc..49f263ef8 100644
--- a/third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts.html
+++ b/third_party/WebKit/LayoutTests/media/auto-play-in-sandbox-with-allow-scripts.html
@@ -2,6 +2,7 @@
 <title>Test that play event fires when "src" set with an autoplay attribute in a sandbox with allows-scripts.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <iframe
     sandbox="allow-scripts allow-same-origin"
     src="resources/auto-play-in-sandbox-with-allow-scripts-iframe.html">
@@ -14,7 +15,7 @@
         var video = iframe.contentDocument.querySelector("video");
         assert_true(video.paused);
         video.onplay = t.step_func_done();
-        video.src = "content/test.ogv";
+        video.src = findMediaFile("video", "content/test");
     });
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-clears-autoplaying-flag.html b/third_party/WebKit/LayoutTests/media/autoplay-clears-autoplaying-flag.html
index f8b413e..a6c5ba5 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-clears-autoplaying-flag.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-clears-autoplaying-flag.html
@@ -2,6 +2,7 @@
 <title>autoplay clears the autoplaying flag</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
 async_test(function(t)
 {
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-document-move.html b/third_party/WebKit/LayoutTests/media/autoplay-document-move.html
index 8047a64..cd55571 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-document-move.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-document-move.html
@@ -2,11 +2,12 @@
 <title>Moving media element to other document to bypass autoplay</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <body>
 <script>
   function createAndMoveVideo() {
     var v = document.implementation.createHTMLDocument().createElement('video');
-    v.src = 'content/test.ogv';
+    v.src = findMediaFile('video', 'content/test');
     document.body.appendChild(v);
     return v;
   }
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-from-mediastream-to-src.html b/third_party/WebKit/LayoutTests/media/autoplay-from-mediastream-to-src.html
index 2e653ba..41031e0 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-from-mediastream-to-src.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-from-mediastream-to-src.html
@@ -2,6 +2,7 @@
 <title>Test for autoplay of video once the media stream is set to null</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
     test(function() {
         assert_true(!!window.internals && !!window.internals.settings,
@@ -16,7 +17,7 @@
 
         setTimeout(t.step_func(function() {
             v.srcObject = null;
-            v.src = 'content/test.ogv';
+            v.src = findMediaFile('video', 'content/test');
 
             v.play()
                 .then(t.unreached_func('The video must not play without user gesture.'))
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-muted-conditions.html b/third_party/WebKit/LayoutTests/media/autoplay-muted-conditions.html
index 16596495..8a0e837 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-muted-conditions.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-muted-conditions.html
@@ -2,6 +2,7 @@
 <title>Test autoplay muted behaviour in various system conditions.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <body></body>
 <script>
 var tests = [
@@ -127,7 +128,7 @@
     });
 
     media.muted = true;
-    media.src = 'content/test.ogv';
+    media.src = findMediaFile('video', 'content/test');
 
     if (type == 'attribute')
       media.autoplay = true;
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-off.html b/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-off.html
index 483cd09..6a71af3 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-off.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-off.html
@@ -4,7 +4,8 @@
   <title>Test muted autoplay videos interaction with data saver on</title>
   <script src="../resources/testharness.js"></script>
   <script src="../resources/testharnessreport.js"></script>
-  </head>
+  <script src="media-file.js"></script>
+</head>
 <body>
 <script>
   window.internals.settings.setAutoplayPolicy('user-gesture-required');
@@ -14,7 +15,7 @@
   promise_test(function(t)
   {
     var video = document.createElement('video');
-    video.src = 'content/test.ogv';
+    video.src = findMediaFile('video', 'content/test');
     video.muted = true;
     return video.play();
   });
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html b/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html
index 23be1ac..b72990d 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html
@@ -4,7 +4,8 @@
   <title>Test muted autoplay videos interaction with data saver on</title>
   <script src="../resources/testharness.js"></script>
   <script src="../resources/testharnessreport.js"></script>
-  </head>
+  <script src="media-file.js"></script>
+</head>
 <body>
 <script>
   window.internals.settings.setAutoplayPolicy('user-gesture-required');
@@ -14,7 +15,7 @@
   promise_test(function(t)
   {
     var video = document.createElement('video');
-    video.src = 'content/test.ogv';
+    video.src = findMediaFile('video', 'content/test');
     video.muted = true;
     return promise_rejects(t,
       new DOMException('play() can only be initiated by a user gesture.',
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-muted.html b/third_party/WebKit/LayoutTests/media/autoplay-muted.html
index cc5fdaf..424de18 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-muted.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-muted.html
@@ -2,6 +2,7 @@
 <title>Test for autoplay of muted video</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <body>
 <script>
@@ -19,7 +20,7 @@
 
     function createMutedMediaElement(type) {
         var e = document.createElement(type);
-        e.src = type == 'audio' ? 'content/test.oga' : 'content/test.ogv';
+        e.src = findMediaFile(type, 'content/test');
         e.muted = true;
         return e;
     }
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-never-visible.html b/third_party/WebKit/LayoutTests/media/autoplay-never-visible.html
index 3765e05..0cc7239 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-never-visible.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-never-visible.html
@@ -2,6 +2,7 @@
 <title>Test behaviour of autoplay muted videos with regards to visibility</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <body>
 <script>
   window.internals.settings.setAutoplayPolicy('user-gesture-required');
@@ -12,7 +13,7 @@
     {
       var video = document.createElement('video');
       video.id = 'offscreen';
-      video.src = 'content/test.ogv';
+      video.src = findMediaFile('video', 'content/test');
       video.muted = true;
       video.autoplay = true;
       video.loop = true;
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-non-whitelisted-scope.html b/third_party/WebKit/LayoutTests/media/autoplay-non-whitelisted-scope.html
index 322f344..d98b9b9d 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-non-whitelisted-scope.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-non-whitelisted-scope.html
@@ -2,6 +2,7 @@
 <title>Test for autoplay of whitelisted frames</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <body>
 <script>
@@ -20,7 +21,7 @@
 
 function createMediaElement(type) {
   var e = document.createElement(type);
-  e.src = type == 'audio' ? 'content/test.oga' : 'content/test.ogv';
+  e.src = findMediaFile(type, 'content/test');
   return e;
 }
 
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-unmute-offscreen.html b/third_party/WebKit/LayoutTests/media/autoplay-unmute-offscreen.html
index df248c60..56b1a74 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-unmute-offscreen.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-unmute-offscreen.html
@@ -2,6 +2,7 @@
 <title>Test that unmuting offscreen video will not allow it to autoplay</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <body>
 <script>
   window.internals.settings.setAutoplayPolicy('user-gesture-required');
@@ -12,7 +13,7 @@
     {
       var video = document.createElement('video');
       video.id = 'offscreen-unmute';
-      video.src = 'content/test.ogv';
+      video.src = findMediaFile('video', 'content/test');
       video.muted = true;
       video.autoplay = true;
       video.loop = true;
@@ -25,7 +26,7 @@
     {
       var video = document.createElement('video');
       video.id = 'offscreen-mute';
-      video.src = 'content/test.ogv';
+      video.src = findMediaFile('video', 'content/test');
       video.muted = true;
       video.autoplay = true;
       video.loop = true;
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-when-visible-multiple-times.html b/third_party/WebKit/LayoutTests/media/autoplay-when-visible-multiple-times.html
index c54d48e..7da22941 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-when-visible-multiple-times.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-when-visible-multiple-times.html
@@ -2,6 +2,7 @@
 <title>Test behaviour of autoplay muted videos with regards to visibility</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <body>
 <script>
   window.internals.settings.setAutoplayPolicy('user-gesture-required');
@@ -38,7 +39,7 @@
     // Create a video off screen.
     {
       video = document.createElement('video');
-      video.src = 'content/test.ogv';
+      video.src = findMediaFile('video', 'content/test');
       video.muted = true;
       video.autoplay = true;
       video.loop = true;
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-when-visible.html b/third_party/WebKit/LayoutTests/media/autoplay-when-visible.html
index 116a624..fadc38b 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-when-visible.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-when-visible.html
@@ -2,6 +2,7 @@
 <title>Test behaviour of autoplay muted videos with regards to visibility</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <body>
 <script>
   window.internals.settings.setAutoplayPolicy('user-gesture-required');
@@ -12,7 +13,7 @@
     {
       var video = document.createElement('video');
       video.id = 'offscreen';
-      video.src = 'content/test.ogv';
+      video.src = findMediaFile('video', 'content/test');
       video.muted = true;
       video.autoplay = true;
       video.loop = true;
@@ -25,7 +26,7 @@
     {
       var video = document.createElement('video');
       video.id = 'inscreen';
-      video.src = 'content/test.ogv';
+      video.src = findMediaFile('video', 'content/test');
       video.muted = true;
       video.autoplay = true;
       video.loop = true;
@@ -35,7 +36,7 @@
     // Create an audio in screen.
     {
       var audio = document.createElement('audio');
-      audio.src = 'content/test.oga';
+      audio.src = findMediaFile('audio', 'content/test');
       audio.muted = true;
       audio.autoplay = true;
       audio.loop = true;
@@ -47,7 +48,7 @@
     {
       var video = document.createElement('video');
       video.id = 'offscreen-no-autoplay';
-      video.src = 'content/test.ogv';
+      video.src = findMediaFile('video', 'content/test');
       video.muted = true;
       video.loop = true;
       video.style.position = 'absolute';
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-whitelisted-scope.html b/third_party/WebKit/LayoutTests/media/autoplay-whitelisted-scope.html
index 849625e..e0817e9 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-whitelisted-scope.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-whitelisted-scope.html
@@ -2,6 +2,7 @@
 <title>Test for autoplay of whitelisted frames</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <body>
 <script>
@@ -21,7 +22,7 @@
 
 function createMediaElement(type) {
   var e = document.createElement(type);
-  e.src = type == 'audio' ? 'content/test.oga' : 'content/test.ogv';
+  e.src = findMediaFile(type, 'content/test');
   return e;
 }
 
diff --git a/third_party/WebKit/LayoutTests/media/autoplay-with-preload-none.html b/third_party/WebKit/LayoutTests/media/autoplay-with-preload-none.html
index cc48eb7..3ce0437 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay-with-preload-none.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-with-preload-none.html
@@ -2,6 +2,7 @@
 <title>autoplay with preload set to none.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
 function autoplay_test(tagName, src)
 {
@@ -29,6 +30,6 @@
     }, tagName + '.autoplay with preload="none"');
 }
 
-autoplay_test('audio', 'content/test.oga');
-autoplay_test('video', 'content/test.ogv');
+autoplay_test('audio', findMediaFile('audio', 'content/test'));
+autoplay_test('video', findMediaFile('video', 'content/test'));
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/autoplay.html b/third_party/WebKit/LayoutTests/media/autoplay.html
index 3dbd455..5fc5231 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay.html
@@ -3,6 +3,7 @@
 <title>autoplay</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
 function autoplay_test(tagName, src)
 {
@@ -29,6 +30,6 @@
     }, tagName + '.autoplay');
 }
 
-autoplay_test('audio', 'content/test.oga');
-autoplay_test('video', 'content/test.ogv');
+autoplay_test('audio', findMediaFile('audio', 'content/test'));
+autoplay_test('video', findMediaFile('video', 'content/test'));
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/autoplay/document-user-activation.html b/third_party/WebKit/LayoutTests/media/autoplay/document-user-activation.html
index 16635b4..e6de7b4 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay/document-user-activation.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay/document-user-activation.html
@@ -2,6 +2,7 @@
 <title>Test document user gesture autoplay policy</title>
 <script src='../../resources/testharness.js'></script>
 <script src='../../resources/testharnessreport.js'></script>
+<script src='../media-file.js'></script>
 <body>
   <div id='target'>target</div>
 </body>
@@ -14,7 +15,7 @@
   window.internals.settings.setAutoplayPolicy('document-user-activation-required');
 
   var video = document.createElement('video');
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
   return promise_rejects(t, 'NotAllowedError', video.play());
 }, 'Not allowed to autoplay without some sort of user gesture');
 
@@ -28,7 +29,7 @@
   eventSender.keyDown('a');
 
   var video = document.createElement('video');
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
   return video.play();
 }, 'Allowed to autoplay if the document received a key event');
 
@@ -50,7 +51,7 @@
   }]);
 
   var video = document.createElement('video');
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
   return video.play();
 }, 'Allowed to autoplay if the document received a click');
 
@@ -78,7 +79,7 @@
   }]);
 
   var video = document.createElement('video');
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
   return video.play();
 }, 'Allowed to autoplay if the document received a tap');
 
@@ -108,7 +109,7 @@
 
   var video =
       document.implementation.createHTMLDocument().createElement('video');
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
   document.body.appendChild(video);  // Moved to `window.document`.
   document.body.removeChild(video);  // To avoid polluting the DOM.
   return video.play();
@@ -137,7 +138,7 @@
       }]);
 
       var video = document.createElement('video');
-      video.src = '../content/test.ogv';
+      video.src = findMediaFile('video', '../content/test');
       video.play().then(resolve, reject);
     });
 
diff --git a/third_party/WebKit/LayoutTests/media/autoplay/media-document-autoplay-enabled.html b/third_party/WebKit/LayoutTests/media/autoplay/media-document-autoplay-enabled.html
index ac39936..c4b2430 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay/media-document-autoplay-enabled.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay/media-document-autoplay-enabled.html
@@ -21,7 +21,7 @@
     }
   });
 
-  iframe.src = '../content/test.ogv';
+  iframe.src = findMediaFile('video', '../content/test');
   document.body.appendChild(iframe);
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/addtrack.html b/third_party/WebKit/LayoutTests/media/avtrack/addtrack.html
index 1c97501..f8e8e078 100644
--- a/third_party/WebKit/LayoutTests/media/avtrack/addtrack.html
+++ b/third_party/WebKit/LayoutTests/media/avtrack/addtrack.html
@@ -4,7 +4,8 @@
         <title>AudioTrackList &amp; VideoTrackList addtrack event</title>
         <script src="../../resources/testharness.js"></script>
         <script src="../../resources/testharnessreport.js"></script>
-            </head>
+        <script src="../media-file.js"></script>
+    </head>
     <body>
         <script>
             function addtrack_test(tagName, src, label)
@@ -53,10 +54,10 @@
                 }, tagName + " : " + label);
             }
 
-            addtrack_test("audio", "../content/test.oga", "audio-only");
-            addtrack_test("audio", "../content/test.ogv", "audio-video");
-            addtrack_test("video", "../content/test.oga", "audio-only");
-            addtrack_test("video", "../content/test.ogv", "audio-video");
+            addtrack_test("audio", findMediaFile("audio", "../content/test"), "audio-only");
+            addtrack_test("audio", findMediaFile("video", "../content/test"), "audio-video");
+            addtrack_test("video", findMediaFile("audio", "../content/test"), "audio-only");
+            addtrack_test("video", findMediaFile("video", "../content/test"), "audio-video");
         </script>
     </body>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/audio-track-enabled.html b/third_party/WebKit/LayoutTests/media/avtrack/audio-track-enabled.html
index 664bbaa..6244af4 100644
--- a/third_party/WebKit/LayoutTests/media/avtrack/audio-track-enabled.html
+++ b/third_party/WebKit/LayoutTests/media/avtrack/audio-track-enabled.html
@@ -4,13 +4,14 @@
         <title>AudioTrack.enabled change</title>
         <script src="../../resources/testharness.js"></script>
         <script src="../../resources/testharnessreport.js"></script>
-            </head>
+        <script src="../media-file.js"></script>
+    </head>
     <body>
         <script>
             async_test(function(t)
             {
                 var audio = document.createElement("audio");
-                audio.src = "../content/test.oga";
+                audio.src = findMediaFile("audio", "../content/test");
 
                 audio.onloadedmetadata = t.step_func(function()
                 {
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/audio-track-properties.html b/third_party/WebKit/LayoutTests/media/avtrack/audio-track-properties.html
index c9aa26a..909849b 100644
--- a/third_party/WebKit/LayoutTests/media/avtrack/audio-track-properties.html
+++ b/third_party/WebKit/LayoutTests/media/avtrack/audio-track-properties.html
@@ -4,7 +4,8 @@
         <title>AudioTrack properties read from input stream metadata</title>
         <script src="../../resources/testharness.js"></script>
         <script src="../../resources/testharnessreport.js"></script>
-            </head>
+        <script src="../media-file.js"></script>
+    </head>
     <body>
         <script>
             async_test(function(t)
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/forget-on-load.html b/third_party/WebKit/LayoutTests/media/avtrack/forget-on-load.html
index b902566a..700a472c 100644
--- a/third_party/WebKit/LayoutTests/media/avtrack/forget-on-load.html
+++ b/third_party/WebKit/LayoutTests/media/avtrack/forget-on-load.html
@@ -4,13 +4,14 @@
         <title>AudioTrackList &amp; VideoTrackList after load()</title>
         <script src="../../resources/testharness.js"></script>
         <script src="../../resources/testharnessreport.js"></script>
-            </head>
+        <script src="../media-file.js"></script>
+    </head>
     <body>
         <script>
             async_test(function(t)
             {
                 var video = document.createElement("video");
-                video.src = "../content/test.ogv";
+                video.src = findMediaFile("video", "../content/test");
 
                 video.addEventListener("loadedmetadata", t.step_func_done(function()
                 {
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/gc.html b/third_party/WebKit/LayoutTests/media/avtrack/gc.html
index e31b4e57..154773c 100644
--- a/third_party/WebKit/LayoutTests/media/avtrack/gc.html
+++ b/third_party/WebKit/LayoutTests/media/avtrack/gc.html
@@ -4,13 +4,14 @@
         <title>AudioTrack &amp; VideoTrack garbage collection</title>
         <script src="../../resources/testharness.js"></script>
         <script src="../../resources/testharnessreport.js"></script>
-            </head>
+        <script src="../media-file.js"></script>
+    </head>
     <body>
         <script>
             async_test(function(t)
             {
                 var video = document.createElement('video');
-                video.src = '../content/test.ogv';
+                video.src = findMediaFile('video', '../content/test');
 
                 video.addEventListener('loadedmetadata', t.step_func_done(function()
                 {
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/getTrackById.html b/third_party/WebKit/LayoutTests/media/avtrack/getTrackById.html
index 6c59ccd5..5b52128 100644
--- a/third_party/WebKit/LayoutTests/media/avtrack/getTrackById.html
+++ b/third_party/WebKit/LayoutTests/media/avtrack/getTrackById.html
@@ -4,7 +4,8 @@
         <title>AudioTrackList &amp; VideoTrackList.getTrackById</title>
         <script src="../../resources/testharness.js"></script>
         <script src="../../resources/testharnessreport.js"></script>
-            </head>
+        <script src="../media-file.js"></script>
+    </head>
     <body>
         <script>
             async_test(function(t)
@@ -17,7 +18,7 @@
                 assert_equals(video.videoTracks.length, 0);
                 assert_equals(video.videoTracks.getTrackById(''), null);
 
-                video.src = '../content/test.ogv';
+                video.src = findMediaFile('video', '../content/test');
 
                 video.addEventListener('loadedmetadata', t.step_func_done(function()
                 {
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/track-switching.html b/third_party/WebKit/LayoutTests/media/avtrack/track-switching.html
index bf577fd5..88f6f1a 100644
--- a/third_party/WebKit/LayoutTests/media/avtrack/track-switching.html
+++ b/third_party/WebKit/LayoutTests/media/avtrack/track-switching.html
@@ -4,7 +4,8 @@
         <title>Media track switching during playback</title>
         <script src="../../resources/testharness.js"></script>
         <script src="../../resources/testharnessreport.js"></script>
-            </head>
+        <script src="../media-file.js"></script>
+    </head>
     <body>
         <script>
             async_test(function(t)
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/video-track-properties.html b/third_party/WebKit/LayoutTests/media/avtrack/video-track-properties.html
index e965134..01e45c94 100644
--- a/third_party/WebKit/LayoutTests/media/avtrack/video-track-properties.html
+++ b/third_party/WebKit/LayoutTests/media/avtrack/video-track-properties.html
@@ -4,7 +4,8 @@
         <title>VideoTrack properties read from input stream metadata</title>
         <script src="../../resources/testharness.js"></script>
         <script src="../../resources/testharnessreport.js"></script>
-            </head>
+        <script src="../media-file.js"></script>
+    </head>
     <body>
         <script>
             async_test(function(t)
diff --git a/third_party/WebKit/LayoutTests/media/avtrack/video-track-selected.html b/third_party/WebKit/LayoutTests/media/avtrack/video-track-selected.html
index 9ec3c5c3..6e7ef4c 100644
--- a/third_party/WebKit/LayoutTests/media/avtrack/video-track-selected.html
+++ b/third_party/WebKit/LayoutTests/media/avtrack/video-track-selected.html
@@ -4,13 +4,14 @@
         <title>VideoTrack.selected change</title>
         <script src="../../resources/testharness.js"></script>
         <script src="../../resources/testharnessreport.js"></script>
-            </head>
+        <script src="../media-file.js"></script>
+    </head>
     <body>
         <script>
             async_test(function(t)
             {
                 var video = document.createElement("video");
-                video.src = "../content/test.ogv";
+                video.src = findMediaFile("video", "../content/test");
 
                 video.onloadedmetadata = t.step_func(function()
                 {
diff --git a/third_party/WebKit/LayoutTests/media/broken-video.html b/third_party/WebKit/LayoutTests/media/broken-video.html
index 638b9b0b..3c477ef 100644
--- a/third_party/WebKit/LayoutTests/media/broken-video.html
+++ b/third_party/WebKit/LayoutTests/media/broken-video.html
@@ -1,12 +1,13 @@
 <!DOCTYPE HTML>
 <title>Test that an invalid video file generates a MEDIA_ERR_SRC_NOT_SUPPORTED error and sets networkState to NETWORK_NO_SOURCE.</title>
+<script src="media-file.js"></script>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/garbage.ogv";
+    video.src = findMediaFile("video", "content/garbage");
     video.onerror = t.step_func_done(function () {
         assert_true(video.error instanceof MediaError);
         assert_equals(video.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
diff --git a/third_party/WebKit/LayoutTests/media/color-profile-video-seek-filter.html b/third_party/WebKit/LayoutTests/media/color-profile-video-seek-filter.html
index 806fb957..8267d19 100644
--- a/third_party/WebKit/LayoutTests/media/color-profile-video-seek-filter.html
+++ b/third_party/WebKit/LayoutTests/media/color-profile-video-seek-filter.html
@@ -38,7 +38,7 @@
     video.pause();
   }, false);
 
-  setSrcByTagName('video', 'content/test.ogv');
+  setSrcByTagName('video', findMediaFile('video', 'content/test'));
   seek(video, 1.0);
 };
 
diff --git a/third_party/WebKit/LayoutTests/media/color-profile-video-seek-object-fit.html b/third_party/WebKit/LayoutTests/media/color-profile-video-seek-object-fit.html
index 57f98b9..c32de0c 100644
--- a/third_party/WebKit/LayoutTests/media/color-profile-video-seek-object-fit.html
+++ b/third_party/WebKit/LayoutTests/media/color-profile-video-seek-object-fit.html
@@ -37,7 +37,7 @@
     video.pause();
   }, false);
 
-  setSrcByTagName('video', 'content/test.ogv');
+  setSrcByTagName('video', findMediaFile('video', 'content/test'));
   seek(video, 3.8);
 };
 
diff --git a/third_party/WebKit/LayoutTests/media/color-profile-video-seek.html b/third_party/WebKit/LayoutTests/media/color-profile-video-seek.html
index f97fb38..f22af0e 100644
--- a/third_party/WebKit/LayoutTests/media/color-profile-video-seek.html
+++ b/third_party/WebKit/LayoutTests/media/color-profile-video-seek.html
@@ -32,7 +32,7 @@
     video.pause();
   }, false);
 
-  setSrcByTagName('video', 'content/test.ogv');
+  setSrcByTagName('video', findMediaFile('video', 'content/test'));
   seek(video, 3.8);
 };
 
diff --git a/third_party/WebKit/LayoutTests/media/color-profile-video.html b/third_party/WebKit/LayoutTests/media/color-profile-video.html
index dcc2a78..d3d1ab2 100644
--- a/third_party/WebKit/LayoutTests/media/color-profile-video.html
+++ b/third_party/WebKit/LayoutTests/media/color-profile-video.html
@@ -35,7 +35,7 @@
     };
   }
 
-  setSrcByTagName('video', 'content/test.ogv');
+  setSrcByTagName('video', findMediaFile('video', 'content/test'));
 };
 </script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/content/test-par-16-9.mp4 b/third_party/WebKit/LayoutTests/media/content/test-par-16-9.mp4
new file mode 100644
index 0000000..a0223dc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/content/test-par-16-9.mp4
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/media/content/test_yuv420.mp4 b/third_party/WebKit/LayoutTests/media/content/test_yuv420.mp4
new file mode 100644
index 0000000..86ce14e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/content/test_yuv420.mp4
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/media/content/test_yuv422.mp4 b/third_party/WebKit/LayoutTests/media/content/test_yuv422.mp4
new file mode 100644
index 0000000..f211e0a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/content/test_yuv422.mp4
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/media/controls-after-reload.html b/third_party/WebKit/LayoutTests/media/controls-after-reload.html
index 453573ab..172306f 100644
--- a/third_party/WebKit/LayoutTests/media/controls-after-reload.html
+++ b/third_party/WebKit/LayoutTests/media/controls-after-reload.html
@@ -29,7 +29,7 @@
     {
         video.removeEventListener("canplaythrough", canplaythrough);
 
-        video.src = "content/test.ogv";
+        video.src = findMediaFile("video", "content/test");
         video.addEventListener("playing", playing);
         video.play();
     }
@@ -38,8 +38,8 @@
     {
         video = document.getElementsByTagName('video')[0];
         video.addEventListener("canplaythrough", canplaythrough);
-
-        video.src = "content/counting.ogv";
+        
+        video.src = findMediaFile("video", "content/counting");
     }
     </script>
 </head>
diff --git a/third_party/WebKit/LayoutTests/media/controls-css-overload.html b/third_party/WebKit/LayoutTests/media/controls-css-overload.html
index 557efe5..2a9f63c0 100644
--- a/third_party/WebKit/LayoutTests/media/controls-css-overload.html
+++ b/third_party/WebKit/LayoutTests/media/controls-css-overload.html
@@ -2,6 +2,7 @@
 <title>Testing that overloading some controls doesn't crash the browser</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <style>
     .nocontrols::-webkit-media-controls-panel {
         display:none;
diff --git a/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering-expected-mismatch.html b/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering-expected-mismatch.html
index e942443..85a48b4 100644
--- a/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering-expected-mismatch.html
+++ b/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering-expected-mismatch.html
@@ -12,7 +12,7 @@
                 testRunner.waitUntilDone();
 
             var video = document.querySelector("video");
-            video.src = "content/test.ogv";
+            video.src = findMediaFile("video", "content/test");
             video.addEventListener("loadeddata", function()
             {
                 if (window.eventSender) {
diff --git a/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering.html b/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering.html
index 9c53639..135ff577 100644
--- a/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering.html
+++ b/third_party/WebKit/LayoutTests/media/controls-drag-timebar-rendering.html
@@ -12,7 +12,7 @@
                 testRunner.waitUntilDone();
 
             var video = document.querySelector("video");
-            video.src = "content/test.ogv";
+            video.src = findMediaFile("video", "content/test");
             video.addEventListener("loadeddata", function()
             {
                 video.play();
diff --git a/third_party/WebKit/LayoutTests/media/controls-drag-timebar.html b/third_party/WebKit/LayoutTests/media/controls-drag-timebar.html
index 91882047..33ca8a60 100644
--- a/third_party/WebKit/LayoutTests/media/controls-drag-timebar.html
+++ b/third_party/WebKit/LayoutTests/media/controls-drag-timebar.html
@@ -2,6 +2,7 @@
 <title>Test that dragging the timebar thumb causes seeks.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls></video>
 <script>
@@ -13,7 +14,7 @@
     var video = document.querySelector("video");
     video.onplaying = t.step_func(playing);
     video.onseeked = t.step_func(seeked);
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.play();
 
     function playing() {
diff --git a/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html b/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html
index 8116ffa..a4ac8c22 100644
--- a/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html
+++ b/third_party/WebKit/LayoutTests/media/controls-repaint-for-network-change-expected.html
@@ -13,7 +13,7 @@
 testRunner.waitUntilDone();
 
 function test() {
-    var src = "content/empty.oga";
+    var src = findMediaFile("audio", "content/empty");
     document.getElementById("audio1").src = src;
 
     runAfterLayoutAndPaint(function() {
diff --git a/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html b/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html
index 2eb4bf2..39cd50f 100644
--- a/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html
+++ b/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html
@@ -2,6 +2,7 @@
 <title>Test that right clicking on the timebar does not cause a seek.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls></video>
 <script>
@@ -15,7 +16,7 @@
     video.onseeked = t.unreached_func();
 
     video.autoplay = true;
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 
     function click() {
         var seekCoords = mediaControlsButtonCoordinates(video, "timeline");
diff --git a/third_party/WebKit/LayoutTests/media/controls-strict.html b/third_party/WebKit/LayoutTests/media/controls-strict.html
index 4ab66b6..de5b4de 100644
--- a/third_party/WebKit/LayoutTests/media/controls-strict.html
+++ b/third_party/WebKit/LayoutTests/media/controls-strict.html
@@ -4,7 +4,7 @@
         <script src="media-file.js"></script>
         <script src="video-paint-test.js"></script>
     </head>
-    <body onload="setSrcByTagName('video', 'content/test.ogv'); init()">
+    <body onload="setSrcByTagName('video', findMediaFile('video', 'content/test')); init()">
         <p>Drawing the controls in strict mode.</p>
         <video controls></video>
     </body>
diff --git a/third_party/WebKit/LayoutTests/media/controls-styling-strict.html b/third_party/WebKit/LayoutTests/media/controls-styling-strict.html
index 03a1bf06..ecc188d 100644
--- a/third_party/WebKit/LayoutTests/media/controls-styling-strict.html
+++ b/third_party/WebKit/LayoutTests/media/controls-styling-strict.html
@@ -10,7 +10,7 @@
             }
         </style>
     </head>
-    <body onload="setSrcByTagName('video', 'content/test.ogv'); init();">
+    <body onload="setSrcByTagName('video', findMediaFile('video', 'content/test')); init();">
         <p>The look of the controls should not change when styled under strict mode.</p>
         <video controls></video>
         <video controls></video>
diff --git a/third_party/WebKit/LayoutTests/media/controls-styling.html b/third_party/WebKit/LayoutTests/media/controls-styling.html
index 6dd98ab2..453ae46 100644
--- a/third_party/WebKit/LayoutTests/media/controls-styling.html
+++ b/third_party/WebKit/LayoutTests/media/controls-styling.html
@@ -15,7 +15,7 @@
     }
     </style>
 </head>
-<body onload="setSrcByTagName('video', 'content/test.ogv'); init()">
+<body onload="setSrcByTagName('video', findMediaFile('video', 'content/test')); init()">
 <p>The look of the controls should not change.</p>
 <div class="override">
     <video controls></video>
diff --git a/third_party/WebKit/LayoutTests/media/controls-timeline.html b/third_party/WebKit/LayoutTests/media/controls-timeline.html
index 2556b64..85bdc617 100644
--- a/third_party/WebKit/LayoutTests/media/controls-timeline.html
+++ b/third_party/WebKit/LayoutTests/media/controls-timeline.html
@@ -2,12 +2,13 @@
 <title>Test seeking on the media controls timeline</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 
     video.onloadedmetadata = t.step_func_done(function() {
         assert_equals(video.currentTime, 0);
diff --git a/third_party/WebKit/LayoutTests/media/controls-volume-slider-keynav.html b/third_party/WebKit/LayoutTests/media/controls-volume-slider-keynav.html
index cd91b0c..187b9f0c 100644
--- a/third_party/WebKit/LayoutTests/media/controls-volume-slider-keynav.html
+++ b/third_party/WebKit/LayoutTests/media/controls-volume-slider-keynav.html
@@ -2,12 +2,13 @@
 <title>Test media controls volume slider keyboard navigation</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <audio controls></audio>
 <script>
 async_test(function(t) {
     var audio = document.querySelector("audio");
-    audio.src = "content/test.oga";
+    audio.src = findMediaFile("audio", "content/test");
     assert_equals(audio.volume, 1);
 
     audio.onloadedmetadata = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/controls-volume-slider.html b/third_party/WebKit/LayoutTests/media/controls-volume-slider.html
index aa88176..8b2f9408 100644
--- a/third_party/WebKit/LayoutTests/media/controls-volume-slider.html
+++ b/third_party/WebKit/LayoutTests/media/controls-volume-slider.html
@@ -2,12 +2,13 @@
 <title>media controls volume slider</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <audio controls></audio>
 <script>
 async_test(function(t) {
     var audio = document.querySelector("audio");
-    audio.src = "content/test.oga";
+    audio.src = findMediaFile("audio", "content/test");
     assert_equals(audio.volume, 1);
 
     audio.onloadedmetadata = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/controls-without-preload.html b/third_party/WebKit/LayoutTests/media/controls-without-preload.html
index d5265ae..f90ffa6 100644
--- a/third_party/WebKit/LayoutTests/media/controls-without-preload.html
+++ b/third_party/WebKit/LayoutTests/media/controls-without-preload.html
@@ -9,7 +9,7 @@
 
             function start()
             {
-                setSrcByTagName("video", "content/test.ogv");
+                setSrcByTagName("video", findMediaFile("video", "content/test"));
                 video = document.getElementsByTagName('video')[0];
                 video.load();
                 video.play();
diff --git a/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset-expected.html b/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset-expected.html
index cfe386e..a5925bb 100644
--- a/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset-expected.html
+++ b/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset-expected.html
@@ -1,11 +1,12 @@
 <!DOCTYPE html>
 <html>
+<script src="../media-file.js"></script>
 <video controls width=400>
   <track kind=subtitles src=fake-en-sub.vtt srclang=en label=English>
   <track kind=subtitles src=fake-fr-sub.vtt srclang=fr label=French>
 </video>
 <script>
   var video = document.querySelector('video');
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
 </script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset.html b/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset.html
index bc27d11..a08cd65 100644
--- a/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset.html
+++ b/third_party/WebKit/LayoutTests/media/controls/buttons-after-reset.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <title>Test that resetting the controls after load is a no-op.</title>
+<script src="../media-file.js"></script>
 <video controls width=400>
   <track kind=subtitles src=fake-en-sub.vtt srclang=en label=English>
   <track kind=subtitles src=fake-fr-sub.vtt srclang=fr label=French>
@@ -10,7 +11,7 @@
     testRunner.waitUntilDone();
 
   var video = document.querySelector('video');
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
   video.addEventListener('loadedmetadata', () => {
     video.controls = false;
     testRunner.layoutAndPaintAsyncThen(() => {
diff --git a/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible-expected.html b/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible-expected.html
index be96cc9..b625f0e 100644
--- a/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible-expected.html
+++ b/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible-expected.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Captions menu always visible - expected</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <style>
   video {
@@ -14,7 +15,7 @@
     testRunner.waitUntilDone();
 
   var video = document.querySelector('video');
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
   video.addTextTrack('captions', 'foo');
   video.addTextTrack('captions', 'bar');
 
diff --git a/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible.html b/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible.html
index 24d9ab2..69df936 100644
--- a/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible.html
+++ b/third_party/WebKit/LayoutTests/media/controls/captions-menu-always-visible.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Captions menu always visible</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <style>
   .container {
@@ -17,7 +18,7 @@
     testRunner.waitUntilDone();
 
   var video = document.querySelector('video');
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
   video.addTextTrack('captions', 'foo');
   video.addTextTrack('captions', 'bar');
 
diff --git a/third_party/WebKit/LayoutTests/media/controls/closed-captions-dynamic-update.html b/third_party/WebKit/LayoutTests/media/controls/closed-captions-dynamic-update.html
index d4c10baa..dc9d80d2 100644
--- a/third_party/WebKit/LayoutTests/media/controls/closed-captions-dynamic-update.html
+++ b/third_party/WebKit/LayoutTests/media/controls/closed-captions-dynamic-update.html
@@ -2,6 +2,7 @@
 <title>Tests that the closed captions button enables track switching.</title>
 <script src='../../resources/testharness.js'></script>
 <script src='../../resources/testharnessreport.js'></script>
+<script src='../media-file.js'></script>
 <script src='../media-controls.js'></script>
 <video controls>
   <track src='../track/captions-webvtt/captions-fast.vtt' kind='captions'>
@@ -66,6 +67,6 @@
     clickTextTrackAtIndex(video, 0);
   });
 
-  video.src = '../content/counting.ogv';
+  video.src = findMediaFile('video', '../content/counting');
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/closed-captions-on-off.html b/third_party/WebKit/LayoutTests/media/controls/closed-captions-on-off.html
index c9d72bb..8558d03 100644
--- a/third_party/WebKit/LayoutTests/media/controls/closed-captions-on-off.html
+++ b/third_party/WebKit/LayoutTests/media/controls/closed-captions-on-off.html
@@ -3,6 +3,7 @@
 <script src='../../resources/testharness.js'></script>
 <script src='../../resources/testharnessreport.js'></script>
 <script src='../media-controls.js'></script>
+<script src='../media-file.js'></script>
 <video controls></video>
 <script>
 async_test(t => {
@@ -44,6 +45,6 @@
     }));
   });
 
-  video.src = '../content/counting.ogv';
+  video.src = findMediaFile('video', '../content/counting');
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/closed-captions-single-track.html b/third_party/WebKit/LayoutTests/media/controls/closed-captions-single-track.html
index 77ee734..554c76fb 100644
--- a/third_party/WebKit/LayoutTests/media/controls/closed-captions-single-track.html
+++ b/third_party/WebKit/LayoutTests/media/controls/closed-captions-single-track.html
@@ -3,6 +3,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <video controls></video>
 <script>
 async_test(t => {
@@ -47,6 +48,6 @@
     }));
   });
 
-  video.src = "../content/counting.ogv";
+  video.src = findMediaFile("video", "../content/counting");
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/closed-captions-switch-track.html b/third_party/WebKit/LayoutTests/media/controls/closed-captions-switch-track.html
index b46f7b45..2915e3f3 100644
--- a/third_party/WebKit/LayoutTests/media/controls/closed-captions-switch-track.html
+++ b/third_party/WebKit/LayoutTests/media/controls/closed-captions-switch-track.html
@@ -2,6 +2,7 @@
 <title>Test that we can add multiple tracks and select between them from the track selection menu.</title>
 <script src='../../resources/testharness.js'></script>
 <script src='../../resources/testharnessreport.js'></script>
+<script src='../media-file.js'></script>
 <script src='../media-controls.js'></script>
 <!-- Width should be large enough to display closed captions button. -->
 <video controls style='width: 500px'></video>
@@ -37,6 +38,6 @@
     }));
   });
 
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-low-end-device.html b/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-low-end-device.html
index 889fc4d..a21dd2b 100644
--- a/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-low-end-device.html
+++ b/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-low-end-device.html
@@ -2,6 +2,7 @@
 <title>media controls cast button low end device</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../remoteplayback/util.js"></script>
 <video width="500"></video>
@@ -22,6 +23,6 @@
       assert_true(isVisible(castButton(video)));
     });
 
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-narrow.html b/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-narrow.html
index 4caab982..34cd5310 100644
--- a/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-narrow.html
+++ b/third_party/WebKit/LayoutTests/media/controls/controls-cast-button-narrow.html
@@ -2,12 +2,13 @@
 <title>media controls cast button</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <video width="100" height="200" controls></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     video.onloadedmetadata = t.step_func(function() {
         // Pretend we have a cast device
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-cast-button.html b/third_party/WebKit/LayoutTests/media/controls/controls-cast-button.html
index 2d74dd26..e3c8a1c 100644
--- a/third_party/WebKit/LayoutTests/media/controls/controls-cast-button.html
+++ b/third_party/WebKit/LayoutTests/media/controls/controls-cast-button.html
@@ -2,12 +2,13 @@
 <title>media controls cast button</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <video controls width="500"></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     video.onloadedmetadata = t.step_func_done(function() {
         // Should not have a cast button by default
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-cast-do-not-fade-out.html b/third_party/WebKit/LayoutTests/media/controls/controls-cast-do-not-fade-out.html
index 91da5e2..ffdcd72 100644
--- a/third_party/WebKit/LayoutTests/media/controls/controls-cast-do-not-fade-out.html
+++ b/third_party/WebKit/LayoutTests/media/controls/controls-cast-do-not-fade-out.html
@@ -2,12 +2,13 @@
 <title>This tests that controls do not fade out when the video is playing remotely.</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <video controls loop></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     video.onplaying = t.step_func(function() {
         internals.mediaPlayerPlayingRemotelyChanged(video, true);
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-cast-overlay-slow-fade.html b/third_party/WebKit/LayoutTests/media/controls/controls-cast-overlay-slow-fade.html
index bf596d1..0b065a0 100644
--- a/third_party/WebKit/LayoutTests/media/controls/controls-cast-overlay-slow-fade.html
+++ b/third_party/WebKit/LayoutTests/media/controls/controls-cast-overlay-slow-fade.html
@@ -2,6 +2,7 @@
 <title>Test that the overlay cast button fades at the right time (neither too soon nor too late).</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <video loop></video>
 <script>
@@ -11,7 +12,7 @@
     var hideTimeoutLowerBound = controlsMouseMovementTimeoutMs - 500;
 
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     video.onplaying = t.step_func(function() {
         setTimeout(t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button-autoplay-muted.html b/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button-autoplay-muted.html
index eb69dea..b3be3ac 100644
--- a/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button-autoplay-muted.html
+++ b/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button-autoplay-muted.html
@@ -2,6 +2,7 @@
 <title>media controls overlay cast button for autoplay muted element</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <body></body>
 <script>
@@ -19,7 +20,7 @@
   var video = document.createElement("video");
   video.muted = true;
   video.autoplay = true;
-  video.src = "../content/test.ogv";
+  video.src = findMediaFile("video", "../content/test");
 
   video.onloadedmetadata = t.step_func_done(function() {
     // Pretend we have a cast device
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button.html b/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button.html
index dbc8311..92b09e0 100644
--- a/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button.html
+++ b/third_party/WebKit/LayoutTests/media/controls/controls-overlay-cast-button.html
@@ -2,12 +2,13 @@
 <title>media controls cast button</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     video.onloadedmetadata = t.step_func_done(function() {
         // Should not have a cast button by default
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-in.html b/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-in.html
index 8680352..d9d2031 100644
--- a/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-in.html
+++ b/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-in.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <title>Test that media controls are painted corrected when using page zoom.</title>
+<script src="../media-file.js"></script>
 <video controls width="400"></video>
 <script>
   var video = document.querySelector('video');
@@ -22,7 +23,7 @@
       testRunner.notifyDone();
   };
 
-  video.src = "../content/test.ogv";
+  video.src = findMediaFile("video", "../content/test");
   video.play();
 </script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-out.html b/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-out.html
index 3adbd69..0c81325 100644
--- a/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-out.html
+++ b/third_party/WebKit/LayoutTests/media/controls/controls-page-zoom-out.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <title>Test that media controls are painted corrected when using page zoom.</title>
+<script src="../media-file.js"></script>
 <video controls width="400"></video>
 <script>
   var video = document.querySelector('video');
@@ -22,7 +23,7 @@
       testRunner.notifyDone();
   };
 
-  video.src = "../content/test.ogv";
+  video.src = findMediaFile("video", "../content/test");
   video.play();
 </script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-no-controls.html b/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-no-controls.html
index 70404f1..fe078711 100644
--- a/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-no-controls.html
+++ b/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-no-controls.html
@@ -2,6 +2,7 @@
 <title>Test media controls video keyboard navigation</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <video></video>
 <script>
@@ -11,7 +12,7 @@
 
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
     assert_equals(video.volume, 1);
     assert_equals(video.currentTime, 0);
 
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-space-vol.html b/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-space-vol.html
index 17bdadf..f958d3c 100644
--- a/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-space-vol.html
+++ b/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav-space-vol.html
@@ -2,6 +2,7 @@
 <title>Test media controls video keyboard navigation for volume and space bar</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <video controls></video>
 <script>
@@ -11,7 +12,7 @@
 
 async_test(function(t) {
   var video = document.querySelector("video");
-  video.src = "../content/test.ogv";
+  video.src = findMediaFile("video", "../content/test");
   assert_equals(video.volume, 1);
   assert_equals(video.currentTime, 0);
 
diff --git a/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav.html b/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav.html
index 6e6a9e1..f93eee4 100644
--- a/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav.html
+++ b/third_party/WebKit/LayoutTests/media/controls/controls-video-keynav.html
@@ -2,6 +2,7 @@
 <title>Test media controls video keyboard navigation</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <video controls></video>
 <script>
@@ -11,7 +12,7 @@
 
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
     assert_equals(video.volume, 1);
     assert_equals(video.currentTime, 0);
 
diff --git a/third_party/WebKit/LayoutTests/media/controls/download-button-displays-with-preload-none.html b/third_party/WebKit/LayoutTests/media/controls/download-button-displays-with-preload-none.html
index 85d9ce6a..89aaad2 100644
--- a/third_party/WebKit/LayoutTests/media/controls/download-button-displays-with-preload-none.html
+++ b/third_party/WebKit/LayoutTests/media/controls/download-button-displays-with-preload-none.html
@@ -2,6 +2,7 @@
 <title>media controls download button preload none</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <video controls preload="none" src="https://someexample.example/example.mp4"></video>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/lazy-loaded-style.html b/third_party/WebKit/LayoutTests/media/controls/lazy-loaded-style.html
index e3839ef3..cde9cf71 100644
--- a/third_party/WebKit/LayoutTests/media/controls/lazy-loaded-style.html
+++ b/third_party/WebKit/LayoutTests/media/controls/lazy-loaded-style.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <title>Test that media controls are styled correctly if lazy loaded.</title>
+<script src="../media-file.js"></script>
 <video width="400"></video>
 <script>
   var video = document.querySelector('video');
@@ -15,7 +16,7 @@
       testRunner.notifyDone();
   };
 
-  video.src = "../content/test.ogv";
+  video.src = findMediaFile("video", "../content/test");
   video.play();
 </script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/overflow-fully-hidden.html b/third_party/WebKit/LayoutTests/media/controls/overflow-fully-hidden.html
index 6c3ba5b..454a7bd 100644
--- a/third_party/WebKit/LayoutTests/media/controls/overflow-fully-hidden.html
+++ b/third_party/WebKit/LayoutTests/media/controls/overflow-fully-hidden.html
@@ -9,6 +9,7 @@
 <meta name='viewport' content='width=800'>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 </head>
 <style>
@@ -26,7 +27,7 @@
 test(_ => {
   var videos = document.querySelectorAll('video');
   for (var video, i = 0; video = videos[i]; ++i) {
-    video.src = '../content/test.ogv';
+    video.src = findMediaFile('video', '../content/test');
   }
 
   var forceLayout = document.body.offsetHeight;
diff --git a/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible-expected.html b/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible-expected.html
index b06e48a..27958cc 100644
--- a/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible-expected.html
+++ b/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible-expected.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Overflow menu always visible - expected</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <style>
   video {
@@ -14,7 +15,7 @@
     testRunner.waitUntilDone();
 
   var video = document.querySelector('video');
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
   video.addTextTrack('captions', 'foo');
   video.addTextTrack('captions', 'bar');
 
diff --git a/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible.html b/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible.html
index 2dad67e..317789a 100644
--- a/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible.html
+++ b/third_party/WebKit/LayoutTests/media/controls/overflow-menu-always-visible.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Overflow menu always visible</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <style>
   .container {
@@ -17,7 +18,7 @@
     testRunner.waitUntilDone();
 
   var video = document.querySelector('video');
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
   video.addTextTrack('captions', 'foo');
   video.addTextTrack('captions', 'bar');
 
diff --git a/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-document-move.html b/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-document-move.html
index cacba37..955b89c 100644
--- a/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-document-move.html
+++ b/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-document-move.html
@@ -2,6 +2,7 @@
 <title>media controls overlay play button document move</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="overlay-play-button.js"></script>
 <body>
@@ -45,7 +46,7 @@
   function createAndMoveVideo() {
     var doc = document.implementation.createHTMLDocument();
     var v = doc.createElement('video');
-    v.src = '../content/test.ogv';
+    v.src = findMediaFile('video', '../content/test');
     v.width = NORMAL_VIDEO_WIDTH;
     v.height = NORMAL_VIDEO_HEIGHT;
     v.controls = true;
diff --git a/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-narrow.html b/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-narrow.html
index 248a6a4..77e37c4a 100644
--- a/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-narrow.html
+++ b/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-narrow.html
@@ -2,6 +2,7 @@
 <title>media controls overlay play button narrow</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="overlay-play-button.js"></script>
 <body>
@@ -12,7 +13,7 @@
   enableOverlayPlayButtonForTest(t);
 
   var video = document.createElement('video');
-  video.src = "../content/test.ogv";
+  video.src = findMediaFile("video", "../content/test");
   video.width = NORMAL_VIDEO_WIDTH;
   video.height = NORMAL_VIDEO_HEIGHT;
   video.controls = true;
diff --git a/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none-custom-bg.html b/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none-custom-bg.html
index 470ca1b..91fb833 100644
--- a/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none-custom-bg.html
+++ b/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none-custom-bg.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <title>Test that player controls are painted correctly with -webkit-appearance: none; and a custom background.</title>
+<script src="../media-file.js"></script>
 <style>
 video::-webkit-media-controls-play-button {
   -webkit-appearance: none;
@@ -10,6 +11,6 @@
 <video controls width=400></video>
 <script>
   var video = document.querySelector('video');
-  video.src = "../content/counting.ogv";
+  video.src = findMediaFile("video", "../content/counting");
 </script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none.html b/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none.html
index 9cfb85a..6772d54b 100644
--- a/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none.html
+++ b/third_party/WebKit/LayoutTests/media/controls/paint-controls-webkit-appearance-none.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <title>Test that player controls are painted correctly with -webkit-appearance: none;</title>
+<script src="../media-file.js"></script>
 <style>
 video::-webkit-media-controls-play-button {
   -webkit-appearance: none;
@@ -9,6 +10,6 @@
 <video controls width=400></video>
 <script>
   var video = document.querySelector('video');
-  video.src = "../content/counting.ogv";
+  video.src = findMediaFile("video", "../content/counting");
 </script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize-expected.html b/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize-expected.html
index 9e80294..4abf143574 100644
--- a/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize-expected.html
+++ b/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize-expected.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that the controls repaint correctly on resize.</title>
+<script src="../media-file.js"></script>
 <video controls width=300></video>
 <script>
 var video = document.querySelector("video");
@@ -14,5 +15,5 @@
     testRunner.notifyDone();
 };
 
-video.src = "../content/test.ogv";
+video.src = findMediaFile("video", "../content/test");
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize.html b/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize.html
index 89ee113..42abd59 100644
--- a/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize.html
+++ b/third_party/WebKit/LayoutTests/media/controls/repaint-on-resize.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that the controls repaint correctly on resize.</title>
+<script src="../media-file.js"></script>
 <video controls width=200></video>
 <script>
 var video = document.querySelector("video");
@@ -15,5 +16,5 @@
     testRunner.notifyDone();
 };
 
-video.src = "../content/test.ogv";
+video.src = findMediaFile("video", "../content/test");
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/rotated-video-has-right-panel-width.html b/third_party/WebKit/LayoutTests/media/controls/rotated-video-has-right-panel-width.html
index 53ee59c..dc67bf1 100644
--- a/third_party/WebKit/LayoutTests/media/controls/rotated-video-has-right-panel-width.html
+++ b/third_party/WebKit/LayoutTests/media/controls/rotated-video-has-right-panel-width.html
@@ -9,6 +9,7 @@
 <meta name='viewport' content='width=800'>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 </head>
 <style>
@@ -34,7 +35,7 @@
 
   var videos = document.querySelectorAll('video');
   for (var i=0; i < videos.length; ++i) {
-    videos[i].src = 'content/test.ogv';
+    videos[i].src = findMediaFile('video', 'content/test');
   }
 
   var forceLayout = document.body.offsetHeight;
diff --git a/third_party/WebKit/LayoutTests/media/controls/settings-disable-controls.html b/third_party/WebKit/LayoutTests/media/controls/settings-disable-controls.html
index d753eb1..2aac53bc 100644
--- a/third_party/WebKit/LayoutTests/media/controls/settings-disable-controls.html
+++ b/third_party/WebKit/LayoutTests/media/controls/settings-disable-controls.html
@@ -2,6 +2,7 @@
 <title>Test that 'mediaControlsEnabled' properly toggles the native controls</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <video controls></video>
 <script>
@@ -35,6 +36,6 @@
     }));
   }));
 
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/time-update-after-unload.html b/third_party/WebKit/LayoutTests/media/controls/time-update-after-unload.html
index 5e6e5607..f1ec7d33 100644
--- a/third_party/WebKit/LayoutTests/media/controls/time-update-after-unload.html
+++ b/third_party/WebKit/LayoutTests/media/controls/time-update-after-unload.html
@@ -1,13 +1,14 @@
 <!DOCTYPE html>
 <html>
 <title>This tests that the controls' current time is updated after media is unloaded</title>
+<script src='../media-file.js'></script>
 <video controls></video>
 <script>
   if (window.testRunner)
     testRunner.waitUntilDone();
 
   var video = document.querySelector('video');
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
 
   // Get the video into a playing state at currentTime > 0.
   video.autoplay = true;
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-frame.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-frame.html
index daa8dec..535d211 100644
--- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-frame.html
+++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-frame.html
@@ -4,6 +4,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <video controls width=400 preload=auto></video>
 <script>
 async_test(t => {
@@ -15,7 +16,7 @@
     checkControlsClassName(video, 'phase-ready state-stopped');
   });
 
-  video.src = '../content/counting.ogv';
+  video.src = findMediaFile('video', '../content/counting');
 });
 </script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-image.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-image.html
index a9bba34..a9cee03 100644
--- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-image.html
+++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-poster-image.html
@@ -4,6 +4,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <video controls width=400 preload=auto poster="../content/greenbox.png"></video>
 <script>
 async_test(t => {
@@ -15,7 +16,7 @@
     checkControlsClassName(video, 'phase-ready state-stopped');
   });
 
-  video.src = '../content/counting.ogv';
+  video.src = findMediaFile('video', '../content/counting');
 });
 </script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-cast.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-cast.html
index ac71d8ab..ee37a61 100644
--- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-cast.html
+++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-cast.html
@@ -4,6 +4,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <video controls width=400></video>
 <script>
 async_test(t => {
@@ -19,7 +20,7 @@
     checkButtonHasClass(castButton(video), 'on');
   });
 
-  video.src = "../content/counting.ogv";
+  video.src = findMediaFile("video", "../content/counting");
   video.play();
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-fullscreen.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-fullscreen.html
index b421e6b..ea43064 100644
--- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-fullscreen.html
+++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-fullscreen.html
@@ -4,6 +4,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <video controls width=400></video>
 <script>
 async_test(t => {
@@ -22,7 +23,7 @@
     clickAtCoordinates(1, 1);
   });
 
-  video.src = "../content/counting.ogv";
+  video.src = findMediaFile("video", "../content/counting");
   video.play();
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-mute.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-mute.html
index cc31a91..368e445 100644
--- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-mute.html
+++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-mute.html
@@ -4,6 +4,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <video controls width=400></video>
 <script>
 async_test(t => {
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-overlay-cast.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-overlay-cast.html
index 14b76a4b..4cebf33 100644
--- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-overlay-cast.html
+++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-overlay-cast.html
@@ -4,6 +4,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <video controls width=400></video>
 <script>
 async_test(t => {
@@ -19,7 +20,7 @@
     checkButtonHasClass(overlayCastButton(video), 'on');
   });
 
-  video.src = "../content/counting.ogv";
+  video.src = findMediaFile("video", "../content/counting");
   video.play();
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-pause.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-pause.html
index b288801..903f2ab 100644
--- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-pause.html
+++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-pause.html
@@ -4,6 +4,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <video controls width=400></video>
 <script>
 async_test(t => {
@@ -14,7 +15,7 @@
     video.pause();
   });
 
-  video.src = "../content/counting.ogv";
+  video.src = findMediaFile("video", "../content/counting");
   video.play().catch(t.step_func_done(_ => {
     checkButtonHasClass(playButton(video), 'pause');
   }));
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-error.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-error.html
index 578001e..f92347d8 100644
--- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-error.html
+++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-error.html
@@ -4,6 +4,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <video controls width=400></video>
 <script>
 async_test(t => {
@@ -14,7 +15,7 @@
     checkControlsClassName(video, "phase-pre-ready state-no-source use-default-poster");
   });
 
-  video.src = "../content/missing.ogv";
+  video.src = findMediaFile("video", "../content/missing");
   // Catch the error promise.
   video.play().catch(() => {});
 });
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-reset.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-reset.html
index f43fa5a..30020bd 100644
--- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-reset.html
+++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-with-state-source-reset.html
@@ -4,6 +4,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <video controls width=400></video>
 <script>
 async_test(t => {
@@ -24,11 +25,11 @@
 
   video.onpause = t.step_func(() => {
     checkControlsClassName(video, "phase-ready state-stopped");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
     video.play();
   });
 
-  video.src = "../content/counting.ogv";
+  video.src = findMediaFile("video", "../content/counting");
   video.play();
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/toggle-class-without-poster.html b/third_party/WebKit/LayoutTests/media/controls/toggle-class-without-poster.html
index 4367906..5c3e123 100644
--- a/third_party/WebKit/LayoutTests/media/controls/toggle-class-without-poster.html
+++ b/third_party/WebKit/LayoutTests/media/controls/toggle-class-without-poster.html
@@ -4,6 +4,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <video controls width=400 preload=metadata></video>
 <script>
 async_test(t => {
@@ -16,7 +17,7 @@
     checkControlsClassName(video, 'phase-ready state-stopped use-default-poster');
   });
 
-  video.src = '../content/counting.ogv';
+  video.src = findMediaFile('video', '../content/counting');
 });
 </script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-appears-when-expected.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-appears-when-expected.html
index d377026..23bae03 100644
--- a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-appears-when-expected.html
+++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-appears-when-expected.html
@@ -3,6 +3,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <script src="../overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -12,7 +13,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "../content/test.ogv";
+  video.src = findMediaFile("video", "../content/test");
   // At this width, the mute and cast button don't fit. Since we have
   // two elements that don't fit, the overflow menu should be visible.
   video.setAttribute("width", "240");
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-outside.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-outside.html
index b0639f1..9e4c3c5 100644
--- a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-outside.html
+++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-outside.html
@@ -3,6 +3,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <script src="../overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -12,7 +13,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "../content/test.ogv";
+  video.src = findMediaFile("video", "../content/test");
   video.setAttribute("width", "60");
   // Add captions
   var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-panel.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-panel.html
index af446c1e6..c0f83b12 100644
--- a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-panel.html
+++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click-panel.html
@@ -3,6 +3,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <script src="../overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -12,7 +13,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "../content/test.ogv";
+  video.src = findMediaFile("video", "../content/test");
   video.setAttribute("width", "200");
   // Add captions
   var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click.html
index 6f3086ed..d6e5a1d 100644
--- a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click.html
+++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-click.html
@@ -3,6 +3,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <script src="../overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -12,7 +13,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "../content/test.ogv";
+  video.src = findMediaFile("video", "../content/test");
   video.setAttribute("width", "60");
   // Add captions
   var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-resize.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-resize.html
index 954fc4d..f892a7e 100644
--- a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-resize.html
+++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-hide-on-resize.html
@@ -9,6 +9,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <script src="../overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -21,7 +22,7 @@
 
   // Set up video
   var video = document.querySelector("video");
-  video.src = "../content/test.ogv";
+  video.src = findMediaFile("video", "../content/test");
   video.setAttribute("width", "60");
   // Add captions
   var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-text.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-text.html
index 32f3876..e629708 100644
--- a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-text.html
+++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-text.html
@@ -3,6 +3,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <script src="../overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -12,7 +13,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "../content/test.ogv";
+  video.src = findMediaFile("video", "../content/test");
   // Add captions
   var track = video.addTextTrack("captions");
   // Pretend we have a cast device
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-visibility.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-visibility.html
index 9d8b37d35..09326a9 100644
--- a/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-visibility.html
+++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-overflow-menu-visibility.html
@@ -3,6 +3,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../media-controls.js"></script>
+<script src="../media-file.js"></script>
 <script src="../overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -12,7 +13,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "../content/test.ogv";
+  video.src = findMediaFile("video", "../content/test");
   video.setAttribute("width", "60");
   // Add captions
   var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-controls-with-cast-rendering.html b/third_party/WebKit/LayoutTests/media/controls/video-controls-with-cast-rendering.html
index dcc23b8..42233d4 100644
--- a/third_party/WebKit/LayoutTests/media/controls/video-controls-with-cast-rendering.html
+++ b/third_party/WebKit/LayoutTests/media/controls/video-controls-with-cast-rendering.html
@@ -35,7 +35,7 @@
                 testRunner.notifyDone();
         });
     });
-    setSrcByTagName('video', '../content/test.ogv');
+    setSrcByTagName('video', findMediaFile('video', '../content/test'));
   </script>
 </body>
 </html>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-while-hovering-shows-controls.html b/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-while-hovering-shows-controls.html
index 2352914a..265039f 100644
--- a/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-while-hovering-shows-controls.html
+++ b/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-while-hovering-shows-controls.html
@@ -4,6 +4,7 @@
 video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 
 <video controls></video>
@@ -79,6 +80,6 @@
     });
   });
 
-  video.src = "../content/test-25fps.ogv";
+  video.src = findMediaFile("video", "../content/test-25fps");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html b/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html
index 1b89422..a00d0a28 100644
--- a/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html
+++ b/third_party/WebKit/LayoutTests/media/controls/video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html
@@ -5,6 +5,7 @@
 <script src="../../fullscreen/full-screen-test.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 
 <video controls></video>
@@ -64,6 +65,6 @@
     });
   });
 
-  video.src = "../content/test-25fps.ogv";
+  video.src = findMediaFile("video", "../content/test-25fps");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-in-scrollable-iframe-has-full-panel.html b/third_party/WebKit/LayoutTests/media/controls/video-in-scrollable-iframe-has-full-panel.html
index 79c124f..4536a90 100644
--- a/third_party/WebKit/LayoutTests/media/controls/video-in-scrollable-iframe-has-full-panel.html
+++ b/third_party/WebKit/LayoutTests/media/controls/video-in-scrollable-iframe-has-full-panel.html
@@ -4,6 +4,7 @@
 <title>Test that overflow-x: hidden with a small viewport doesn't clip the controls when in a scrollable iframe</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 </head>
 <style>
@@ -55,7 +56,7 @@
 
     let videos = iframedoc.querySelectorAll('video');
     for (let i=0; i < videos.length; ++i) {
-      videos[i].src = 'content/test.ogv';
+      videos[i].src = findMediaFile('video', 'content/test');
     }
   }
 
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-dark-rendering.html b/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-dark-rendering.html
index 8920852..adb6744 100644
--- a/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-dark-rendering.html
+++ b/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-dark-rendering.html
@@ -35,7 +35,7 @@
                 testRunner.notifyDone();
         });
     });
-    setSrcByTagName('video', '../content/test.ogv');
+    setSrcByTagName('video', findMediaFile('video', '../content/test'));
   </script>
 </body>
 </html>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-light-rendering.html b/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-light-rendering.html
index 9a7a288..57d06bd 100644
--- a/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-light-rendering.html
+++ b/third_party/WebKit/LayoutTests/media/controls/video-overlay-cast-light-rendering.html
@@ -35,7 +35,7 @@
                 testRunner.notifyDone();
         });
     });
-    setSrcByTagName('video', '../content/counting.ogv');
+    setSrcByTagName('video', findMediaFile('video', '../content/counting'));
   </script>
 </body>
 </html>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/controls/video-overlay-play-button.html b/third_party/WebKit/LayoutTests/media/controls/video-overlay-play-button.html
index a67b93d..9534c57 100644
--- a/third_party/WebKit/LayoutTests/media/controls/video-overlay-play-button.html
+++ b/third_party/WebKit/LayoutTests/media/controls/video-overlay-play-button.html
@@ -2,6 +2,7 @@
 <title>Test that the overlay play button respects the controls attribute.</title>
 <script src='../../resources/testharness.js'></script>
 <script src='../../resources/testharnessreport.js'></script>
+<script src='../media-file.js'></script>
 <script src='../media-controls.js'></script>
 <body>
 <script>
@@ -48,6 +49,6 @@
     assert_equals(getComputedStyle(button).display, 'flex');
   }));
 
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute-expected.html b/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute-expected.html
index 1dc96a5..bbc38a8 100644
--- a/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute-expected.html
+++ b/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute-expected.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html>
+<script src="../media-file.js"></script>
 <audio controls></audio>
 <video controls></video>
 <script>
   var audio = document.querySelector('audio')
-  audio.src = '../content/test.oga';
+  audio.src = findMediaFile('audio', '../content/test');
   audio.muted = true;
 
   var video = document.querySelector('video');
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
   video.muted = true;
 </script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute.html b/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute.html
index abc11b9..157aad88 100644
--- a/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute.html
+++ b/third_party/WebKit/LayoutTests/media/controls/volumechange-muted-attribute.html
@@ -1,13 +1,14 @@
 <!DOCTYPE html>
 <html>
 <title>This tests that controls are properly updated when muted content attribute is changed.</title>
+<script src="../media-file.js"></script>
 <audio controls muted></audio>
 <video controls muted></video>
 <script>
   var audio = document.querySelector('audio');
-  audio.src = '../content/test.oga';
+  audio.src = findMediaFile('audio', '../content/test');
 
   var video = document.querySelector('video');
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
 </script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation-expected.html b/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation-expected.html
index 53df22e..2cd2991f 100644
--- a/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation-expected.html
+++ b/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation-expected.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <html>
+<script src="../media-file.js"></script>
 <div>
   <audio controls muted></audio>
 </div>
@@ -15,10 +16,10 @@
 <script>
   var audios = document.querySelectorAll('audio');
   for (var i = 0; i < audios.length; ++i)
-    audios[i].src = '../content/test.oga';
+    audios[i].src = findMediaFile('audio', '../content/test');
 
   var videos = document.querySelectorAll('video');
   for (var i = 0; i < videos.length; ++i)
-    videos[i].src = '../content/test.ogv';
+    videos[i].src = findMediaFile('video', '../content/test');
 </script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation.html b/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation.html
index a0d9760..3a44866 100644
--- a/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation.html
+++ b/third_party/WebKit/LayoutTests/media/controls/volumechange-stopimmediatepropagation.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <title>This tests that controls are properly updated when stopImmediatePropagation is used in event handler.</title>
+<script src="../media-file.js"></script>
 <div>
   <audio></audio>
 </div>
@@ -16,27 +17,27 @@
   var audio = document.createElement('audio');
   audio.onvolumechange = e => { e.stopImmediatePropagation() };
   document.querySelector('#a').appendChild(audio);
-  audio.src = '../content/test.oga';
+  audio.src = findMediaFile('audio', '../content/test');
   audio.controls = true;
   audio.onloadedmetadata = () => { audio.muted = true; }
 
   var video = document.createElement('video');
   video.onvolumechange = e => { e.stopImmediatePropagation() };
   document.querySelector('#v').appendChild(video);
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
   video.controls = true;
   video.onloadedmetadata = () => { video.muted = true; }
 
   // Elements created during parsing.
   var audio = document.querySelector('audio');
   audio.onvolumechange = e => { e.stopImmediatePropagation() };
-  audio.src = '../content/test.oga';
+  audio.src = findMediaFile('audio', '../content/test');
   audio.controls = true;
   audio.muted = true;
 
   var video = document.querySelector('video');
   video.onvolumechange = e => { e.stopImmediatePropagation() };
-  video.src = '../content/test.ogv';
+  video.src = findMediaFile('video', '../content/test');
   video.controls = true;
   video.muted = true;
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/csp-blocks-video.html b/third_party/WebKit/LayoutTests/media/csp-blocks-video.html
index 2e0d3f2..edf8396 100644
--- a/third_party/WebKit/LayoutTests/media/csp-blocks-video.html
+++ b/third_party/WebKit/LayoutTests/media/csp-blocks-video.html
@@ -4,10 +4,11 @@
 <video></video>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 
     video.onloadedmetadata = t.unreached_func();
     video.onerror = t.step_func_done();
diff --git a/third_party/WebKit/LayoutTests/media/event-attributes.html b/third_party/WebKit/LayoutTests/media/event-attributes.html
index 33a49f6..c707258 100644
--- a/third_party/WebKit/LayoutTests/media/event-attributes.html
+++ b/third_party/WebKit/LayoutTests/media/event-attributes.html
@@ -2,6 +2,7 @@
 <title>Test event attributes for media element.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video controls></video>
 <script>
 async_test(function(t) {
@@ -60,7 +61,7 @@
 
     video.onended = t.step_func(function(event) {
         actual_events.push(event.type);
-        video.src = "content/garbage.ogv";
+        video.src = findMediaFile("video", "content/garbage");
         progressEventCount = 0;
     });
 
@@ -88,6 +89,6 @@
     video.onplay = defaultEventStepFunction;
     video.onseeking = defaultEventStepFunction;
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/fullscreen-controls-visible-last.html b/third_party/WebKit/LayoutTests/media/fullscreen-controls-visible-last.html
index 085ad74..f46b8f29 100644
--- a/third_party/WebKit/LayoutTests/media/fullscreen-controls-visible-last.html
+++ b/third_party/WebKit/LayoutTests/media/fullscreen-controls-visible-last.html
@@ -2,13 +2,14 @@
 <title>Tests that the fullscreen button control is the antepenultimate media controls button visible.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <script src="overflow-menu.js"></script>
 <video controls></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     // Since this is a video, we'll have three elements visible when the width
     // is 120. These three should be: play, fullscreen, overflow.
     video.setAttribute("width", "120");
diff --git a/third_party/WebKit/LayoutTests/media/gc-pending-event.html b/third_party/WebKit/LayoutTests/media/gc-pending-event.html
index f220227..6effe6a 100644
--- a/third_party/WebKit/LayoutTests/media/gc-pending-event.html
+++ b/third_party/WebKit/LayoutTests/media/gc-pending-event.html
@@ -2,6 +2,7 @@
 <title>Verify that a pending event prevents GC</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
 async_test(function(t)
 {
diff --git a/third_party/WebKit/LayoutTests/media/gc-while-playing.html b/third_party/WebKit/LayoutTests/media/gc-while-playing.html
index 08483e7..d34139b 100644
--- a/third_party/WebKit/LayoutTests/media/gc-while-playing.html
+++ b/third_party/WebKit/LayoutTests/media/gc-while-playing.html
@@ -2,12 +2,13 @@
 <title>GC while playing</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
 async_test(function(t)
 {
     var a = document.createElement("audio");
     a.foo = "bar";
-    a.src = "content/test.oga";
+    a.src = findMediaFile("audio", "content/test");
     a.onsuspend = t.step_func(function()
     {
         assert_equals(a.networkState, a.NETWORK_IDLE);
diff --git a/third_party/WebKit/LayoutTests/media/gc-while-seeking.html b/third_party/WebKit/LayoutTests/media/gc-while-seeking.html
index dcd665b..37add463 100644
--- a/third_party/WebKit/LayoutTests/media/gc-while-seeking.html
+++ b/third_party/WebKit/LayoutTests/media/gc-while-seeking.html
@@ -2,12 +2,13 @@
 <title>GC while seeking</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
 async_test(function(t)
 {
     var a = document.createElement("audio");
     a.foo = "bar";
-    a.src = "content/test.oga";
+    a.src = findMediaFile("audio", "content/test");
     a.onsuspend = t.step_func(function()
     {
         assert_equals(a.networkState, a.NETWORK_IDLE);
diff --git a/third_party/WebKit/LayoutTests/media/media-can-load-when-hidden.html b/third_party/WebKit/LayoutTests/media/media-can-load-when-hidden.html
index 14b3a8aa..d3e2858 100644
--- a/third_party/WebKit/LayoutTests/media/media-can-load-when-hidden.html
+++ b/third_party/WebKit/LayoutTests/media/media-can-load-when-hidden.html
@@ -4,12 +4,13 @@
     video { display: none; }
 </style>
 <video></video>
+<script src="media-file.js"></script>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
     video.ondurationchange = t.step_func_done();
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-mpeg-audio.html b/third_party/WebKit/LayoutTests/media/media-can-play-mpeg-audio.html
new file mode 100644
index 0000000..cd27f000
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-mpeg-audio.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<title>Test HTMLMediaElement's "canPlayType" method with multiple audio mpeg MIME types.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<audio></audio>
+<script>
+test(function() {
+    var audio = document.querySelector("audio");
+    // Currently no platform supports the below formats.
+    assert_equals(audio.canPlayType("audio/x-mpeg"), "");
+    assert_equals(audio.canPlayType("audio/x-mp3"), "");
+    assert_equals(audio.canPlayType("audio/mp3"), "");
+    assert_equals(audio.canPlayType("audio/mpeg"), "");
+
+    assert_equals(audio.canPlayType("audio/mp4"), "");
+    assert_equals(audio.canPlayType("audio/aac"), "");
+});
+</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-mpeg4-video.html b/third_party/WebKit/LayoutTests/media/media-can-play-mpeg4-video.html
new file mode 100644
index 0000000..adb4e7a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-mpeg4-video.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<title>Test HTMLMediaElement's "canPlayType" method with multiple video mpeg4 MIME types.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<video></video>
+<script>
+test(function() {
+    var video = document.querySelector("video");
+    // Currently no platform supports the below formats.
+    assert_equals(video.canPlayType("video/x-m4v"), "");
+    assert_equals(video.canPlayType("video/mp4"), "");
+    assert_equals(video.canPlayType("video/mp4; Codecs=\"avc1.4D400C\""), "");
+    assert_equals(video.canPlayType("Video/MP4; CODECS=\"mp4v.20.8, mp4a.40.2\""), "");
+});
+</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html b/third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html
new file mode 100644
index 0000000..8d38917
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<title>Test HTMLMediaElement's "canPlayType" method with "application/octet-stream".</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+function check_media_element_canplaytype(elementName) {
+    test(function() {
+    	var mediaElement = document.createElement(elementName);
+        // These tests should always pass as no platform
+        // should support "application/octet-stream".
+        assert_equals(mediaElement.canPlayType("APPLICATION/octet-stream"), "");
+        assert_equals(mediaElement.canPlayType("application/octet-stream;codecs=theora"), "");
+        assert_equals(mediaElement.canPlayType("application/octet-stream;codecs=mp4"), "");
+    }, "check \"canPlayType\" method for " + elementName);
+}
+
+check_media_element_canplaytype("audio");
+check_media_element_canplaytype("video");
+</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-ogg.html b/third_party/WebKit/LayoutTests/media/media-can-play-ogg.html
new file mode 100644
index 0000000..487f189
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-ogg.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<title>Test HTMLMediaElement's "canPlayType" method for ogg media containers.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<video></video>
+<script>
+test(function() {
+    var video = document.querySelector('video');
+    // These tests may be expected to fail if the platform does not support the format.
+    assert_equals(video.canPlayType('audio/ogg'), 'maybe');
+    assert_equals(video.canPlayType('video/ogg'), 'maybe');
+
+    assert_equals(video.canPlayType('audio/ogg; codecs=vorbis'), 'probably');
+    assert_equals(video.canPlayType('audio/ogg; codecs=opus'), 'probably');
+    assert_equals(video.canPlayType('video/ogg; codecs=theora'), 'probably');
+    assert_equals(video.canPlayType('video/ogg; codecs="theora,vorbis"'), 'probably');
+});
+</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-type.html b/third_party/WebKit/LayoutTests/media/media-can-play-type.html
new file mode 100644
index 0000000..237ed18
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-type.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<title>Test HTMLMediaElement's "canPlayType" method with invalid MIME types.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<video></video>
+<script>
+test(function() {
+    var video = document.querySelector("video");
+
+    assert_throws(new TypeError, function() { video.canPlayType(); });
+    assert_equals(video.canPlayType("video/"), "");
+    assert_equals(video.canPlayType("video/blahblah"), "");
+    assert_equals(video.canPlayType("video/blahblah; codecs=\"blah,  , blah\""), "");
+    assert_equals(video.canPlayType("video/blahblah; codecs=blah"), "");
+    assert_equals(video.canPlayType("video/blahblah; codecs=\"blah\""), "");
+    assert_equals(video.canPlayType("video/blahblah; codecs=\"badcontent"), "");
+    assert_equals(video.canPlayType("video/blahblah; codecs=badcontent\""), "");
+    assert_equals(video.canPlayType("video/blahblah; codecs=&quot;badcontent&quot;"), "");
+});
+</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-wav-audio.html b/third_party/WebKit/LayoutTests/media/media-can-play-wav-audio.html
new file mode 100644
index 0000000..70f9422
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-wav-audio.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<title>Test HTMLMediaElement's "canPlayType" method with multiple .wav MIME types.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<audio></audio>
+<script>
+test(function() {
+    var audio = document.querySelector("audio");
+    // These tests may be expected to fail if the platform does not support the format.
+    assert_equals(audio.canPlayType("audio/wav"), "maybe");
+    assert_equals(audio.canPlayType("audio/x-wav"), "maybe");
+
+    // WAV codec 1 is basic PCM, refer to http://tools.ietf.org/html/rfc2361
+    assert_equals(audio.canPlayType("audio/wav; codecs=1"), "probably");
+    assert_equals(audio.canPlayType("audio/x-wav; codecs=1"), "probably");
+});
+</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-webm.html b/third_party/WebKit/LayoutTests/media/media-can-play-webm.html
new file mode 100644
index 0000000..9e8531a9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-webm.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<title>Test HTMLMediaElement's "canPlayType" method for webm media containers.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<video></video>
+<script>
+test(function() {
+    var video = document.querySelector('video');
+    // These tests may be expected to fail if the platform does not support the format.
+    assert_equals(video.canPlayType('audio/webm'), 'maybe');
+    assert_equals(video.canPlayType('video/webm'), 'maybe');
+
+    assert_equals(video.canPlayType('audio/webm; codecs=vorbis'), 'probably');
+    assert_equals(video.canPlayType('video/webm; codecs="vp8,vorbis"'), 'probably');
+    assert_equals(video.canPlayType('video/webm; codecs=vp8'), 'probably');
+    assert_equals(video.canPlayType('video/webm; codecs=vp8.0'), 'probably');
+    assert_equals(video.canPlayType('video/webm; codecs="vp8.0,vorbis"'), 'probably');
+    assert_equals(video.canPlayType('video/webm; codecs=vp8.1'), '');
+
+    assert_equals(video.canPlayType('video/webm; codecs=vp9'), 'probably');
+    assert_equals(video.canPlayType('video/webm; codecs="vp9,vorbis"'), 'probably');
+    assert_equals(video.canPlayType('video/webm; codecs=vp9.0'), 'probably');
+    assert_equals(video.canPlayType('video/webm; codecs="vp9.0,vorbis"'), 'probably');
+    assert_equals(video.canPlayType('video/webm; codecs=vp9.1'), '');
+
+    assert_equals(video.canPlayType('audio/webm; codecs=opus'), 'probably');
+    assert_equals(video.canPlayType('video/webm; codecs="vp9,opus"'), 'probably');
+    assert_equals(video.canPlayType('video/webm; codecs="vp9.0,opus"'), 'probably');
+    assert_equals(video.canPlayType('video/webm; codecs="vp8,opus"'), 'probably');
+    assert_equals(video.canPlayType('video/webm; codecs="vp8.0,opus"'), 'probably');
+});
+</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-captions-no-controls.html b/third_party/WebKit/LayoutTests/media/media-captions-no-controls.html
index e2a0aabb..9565c03 100644
--- a/third_party/WebKit/LayoutTests/media/media-captions-no-controls.html
+++ b/third_party/WebKit/LayoutTests/media/media-captions-no-controls.html
@@ -2,12 +2,13 @@
 <title>Tests that adding a text track does not make controls visible.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 
     video.oncanplaythrough = t.step_func_done(function() {
         // Initial state: no text tracks, controls should not be visible.
diff --git a/third_party/WebKit/LayoutTests/media/media-continues-playing-after-replace-source.html b/third_party/WebKit/LayoutTests/media/media-continues-playing-after-replace-source.html
index 6e9eaf2..fb9aaed8 100644
--- a/third_party/WebKit/LayoutTests/media/media-continues-playing-after-replace-source.html
+++ b/third_party/WebKit/LayoutTests/media/media-continues-playing-after-replace-source.html
@@ -2,16 +2,17 @@
 <title>Test that media keeps playing when the source element is replaced.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <audio></audio>
 <script>
 async_test(function(t) {
     // TODO(srirama.m): Improve the test for better understanding
     var timeupdateEventCount = 0;
     var sourceReplaced = false;
-
+    
     var audio = document.querySelector("audio");
     var source = document.createElement("source");
-    source.src = "content/silence.oga";
+    source.src = findMediaFile("audio", "content/silence");
     audio.appendChild(source);
 
     audio.onerror = t.unreached_func();
@@ -33,10 +34,10 @@
                 // Replacing the media's source element.
                 sourceReplaced = true;
                 timeupdateEventCount = 0;
-
+                
                 audio.removeChild(source);
                 var newSource = document.createElement("source");
-                newSource.src = "content/test.oga";
+                newSource.src = findMediaFile("audio", "content/test");
                 audio.appendChild(newSource);
             } else {
                 t.done();
diff --git a/third_party/WebKit/LayoutTests/media/media-controls-fit-properly-while-zoomed.html b/third_party/WebKit/LayoutTests/media/media-controls-fit-properly-while-zoomed.html
index 62d29a1..6a849f9 100644
--- a/third_party/WebKit/LayoutTests/media/media-controls-fit-properly-while-zoomed.html
+++ b/third_party/WebKit/LayoutTests/media/media-controls-fit-properly-while-zoomed.html
@@ -14,7 +14,7 @@
         <video id="video" width="300px" controls></video>
         <script>
         var element = document.getElementById("video");
-        element.src = "content/counting.ogv";
+        element.src = findMediaFile("video", "content/counting");
 
         function testTimelineVisible(test) {
           // Check that the timeline is shown.  If zoom is not accounted for,
diff --git a/third_party/WebKit/LayoutTests/media/media-controls-hide-menu-stoppropagation.html b/third_party/WebKit/LayoutTests/media/media-controls-hide-menu-stoppropagation.html
index de7ab9b..72145c4 100644
--- a/third_party/WebKit/LayoutTests/media/media-controls-hide-menu-stoppropagation.html
+++ b/third_party/WebKit/LayoutTests/media/media-controls-hide-menu-stoppropagation.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="media-controls.js"></script>
+<script src="media-file.js"></script>
 <script src="overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -12,7 +13,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "content/test.ogv";
+  video.src = findMediaFile("video", "content/test");
   video.setAttribute("width", "60");
   // Add captions
   var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/media-controls-invalid-url.html b/third_party/WebKit/LayoutTests/media/media-controls-invalid-url.html
index daae64d..e0081c6 100644
--- a/third_party/WebKit/LayoutTests/media/media-controls-invalid-url.html
+++ b/third_party/WebKit/LayoutTests/media/media-controls-invalid-url.html
@@ -2,12 +2,13 @@
 <title>This tests that media element controls are reset to their default state when the src is changed to an invalid url.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 
     video.oncanplaythrough = t.step_func(function() {
         video.oncanplaythrough = null;
diff --git a/third_party/WebKit/LayoutTests/media/media-controls-overflow-hidden.html b/third_party/WebKit/LayoutTests/media/media-controls-overflow-hidden.html
index 8b55e97..dea8af9 100644
--- a/third_party/WebKit/LayoutTests/media/media-controls-overflow-hidden.html
+++ b/third_party/WebKit/LayoutTests/media/media-controls-overflow-hidden.html
@@ -9,6 +9,7 @@
 <meta name='viewport' content='width=800'>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 </head>
 <style>
@@ -33,7 +34,7 @@
 
   var videos = document.querySelectorAll('video');
   for (var i=0; i < videos.length; ++i) {
-    videos[i].src = 'content/test.ogv';
+    videos[i].src = findMediaFile('video', 'content/test');
   }
 
   var forceLayout = document.body.offsetHeight;
diff --git a/third_party/WebKit/LayoutTests/media/media-controls-overflow-visible.html b/third_party/WebKit/LayoutTests/media/media-controls-overflow-visible.html
index 210ec351..89b3089 100644
--- a/third_party/WebKit/LayoutTests/media/media-controls-overflow-visible.html
+++ b/third_party/WebKit/LayoutTests/media/media-controls-overflow-visible.html
@@ -9,6 +9,7 @@
 <meta name='viewport' content='width=300'>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 </head>
 <body>
@@ -28,7 +29,7 @@
 
   var videos = document.querySelectorAll('video');
   for (var i=0; i < videos.length; ++i) {
-    videos[i].src = 'content/test.ogv';
+    videos[i].src = findMediaFile('video', 'content/test');
   }
 
   var forceLayout = document.body.offsetHeight;
diff --git a/third_party/WebKit/LayoutTests/media/media-controls-tap-show-controls-without-activating.html b/third_party/WebKit/LayoutTests/media/media-controls-tap-show-controls-without-activating.html
index 8ce4736..16a0c6f 100644
--- a/third_party/WebKit/LayoutTests/media/media-controls-tap-show-controls-without-activating.html
+++ b/third_party/WebKit/LayoutTests/media/media-controls-tap-show-controls-without-activating.html
@@ -2,12 +2,13 @@
 <title>Test that when tapping on the controls to show them it does not activate the button below.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls loop></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.play();
 
     video.onplaying = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/media-element-play-after-eos.html b/third_party/WebKit/LayoutTests/media/media-element-play-after-eos.html
index 1a1ae92..be4404e3 100644
--- a/third_party/WebKit/LayoutTests/media/media-element-play-after-eos.html
+++ b/third_party/WebKit/LayoutTests/media/media-element-play-after-eos.html
@@ -2,12 +2,13 @@
 <title>This test ensures that media element fires the "playing" event every time it starts playing after eos. It also ensure that "pause" and "ended" events are fired when media playback ends.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <audio></audio>
 <script>
 async_test(function(t) {
     var loop = true;
     var audio = document.querySelector("audio");
-    audio.src = "content/silence.oga";
+    audio.src = findMediaFile("audio", "content/silence");
 
     var watcher = new EventWatcher(t, audio, ["loadedmetadata", "playing", "pause", "ended"]);
     watcher.wait_for("loadedmetadata").then(t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/media-ended.html b/third_party/WebKit/LayoutTests/media/media-ended.html
index 10157c21..3e15554f 100644
--- a/third_party/WebKit/LayoutTests/media/media-ended.html
+++ b/third_party/WebKit/LayoutTests/media/media-ended.html
@@ -2,6 +2,7 @@
 <title>Test "ended" event fires again after changing source after "ended" event.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <audio autoplay></audio>
 <script>
 async_test(function(t) {
@@ -28,7 +29,7 @@
                 }
 
                 // Change src but don't seek so that internal state isn't reset.
-                audio.src = "content/silence.oga";
+                audio.src = findMediaFile("audio", "content/silence");
                 assert_false(audio.ended);
 
                 break;
@@ -39,6 +40,6 @@
         }
     });
 
-    audio.src = "content/silence.oga"
+    audio.src = findMediaFile("audio", "content/silence")
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/media-extension-with-fragment.html b/third_party/WebKit/LayoutTests/media/media-extension-with-fragment.html
index dbd5412..04df5d913f 100644
--- a/third_party/WebKit/LayoutTests/media/media-extension-with-fragment.html
+++ b/third_party/WebKit/LayoutTests/media/media-extension-with-fragment.html
@@ -2,12 +2,13 @@
 <title>Test that a media url with fragment loads properly</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
     video.onloadeddata = t.step_func_done();
     video.onerror = t.unreached_func();
-    video.src = "content/test.ogv" + "#01.00.xyz";
+    video.src = findMediaFile("video", "content/test") + "#01.00.xyz";
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-file.js b/third_party/WebKit/LayoutTests/media/media-file.js
index 80eef5c..c80abcb 100644
--- a/third_party/WebKit/LayoutTests/media/media-file.js
+++ b/third_party/WebKit/LayoutTests/media/media-file.js
@@ -10,6 +10,25 @@
     ["video/webm","webm"]
 ];
 
+function findMediaFile(tagName, name) {
+    var codecs;
+    if (tagName == "audio")
+        codecs = audioCodecs;
+    else
+        codecs = videoCodecs;
+
+    var element = document.getElementsByTagName(tagName)[0];
+    if (!element)
+        element = document.createElement(tagName);
+
+    for (var i = 0; i < codecs.length; ++i) {
+        if (element.canPlayType(codecs[i][0]))
+            return name + "." + codecs[i][1];
+    }
+
+    return "";
+}
+
 function mimeTypeForExtension(extension) {
     for (var i = 0; i < videoCodecs.length; ++i) {
         if (extension == videoCodecs[i][1])
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/media-fragments.js b/third_party/WebKit/LayoutTests/media/media-fragments/media-fragments.js
index ed40715..fd6cc1e72 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/media-fragments.js
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/media-fragments.js
@@ -2,7 +2,7 @@
     var consoleDiv = null;
     var currentTest = null;
     var fragmentEndTime;
-    var testData =
+    var testData = 
     {
         // http://www.w3.org/2008/WebVideo/Fragments/TC/ua-test-cases
 
@@ -231,10 +231,10 @@
     function start()
     {
         video = document.createElement('video');
-        video.setAttribute('id', 'vid');
-        video.setAttribute('width', '320');
-        video.setAttribute('height', '240');
-        video.setAttribute('controls', '');
+        video.setAttribute('id', 'vid'); 
+        video.setAttribute('width', '320'); 
+        video.setAttribute('height', '240'); 
+        video.setAttribute('controls', ''); 
         var paragraph = document.createElement('p');
         paragraph.appendChild(video);
         document.body.appendChild(paragraph);
@@ -249,6 +249,6 @@
         consoleWrite("<br>Title: <b>" + currentTest + "</b>");
         consoleWrite("Fragment: '<i>" + info.fragment + "</i>'");
         consoleWrite("Comment: <i>" + info.comment + "</i>");
-        url = "../content/counting.ogv" + "#" + info.fragment;
+        url = findMediaFile("video", "../content/counting") + "#" + info.fragment;
         video.src = url;
     }
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-load-event.html b/third_party/WebKit/LayoutTests/media/media-load-event.html
index 25f80ce..c6b2ef1 100644
--- a/third_party/WebKit/LayoutTests/media/media-load-event.html
+++ b/third_party/WebKit/LayoutTests/media/media-load-event.html
@@ -2,6 +2,7 @@
 <title>Test that media file is not reloaded when an element is inserted into the DOM.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <div id="parent"></div>
 <script>
 async_test(function(t) {
@@ -19,7 +20,7 @@
     audio.onplay = t.step_func(function() {});
     audio.onloadeddata = t.step_func(function() {});
 
-    audio.src = "content/test.oga";
+    audio.src = findMediaFile("audio", "content/test");
     audio.load();
 })
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/media-play-promise.html b/third_party/WebKit/LayoutTests/media/media-play-promise.html
index 0c14e9e..e70ef77a 100644
--- a/third_party/WebKit/LayoutTests/media/media-play-promise.html
+++ b/third_party/WebKit/LayoutTests/media/media-play-promise.html
@@ -2,6 +2,7 @@
 <title>Test the play() behaviour with regards to the returned promise for media elements.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
 // This is testing the behavior of play() with regards to the returned
 // promise. This test file is creating a small framework in order to be able
@@ -13,7 +14,7 @@
     // Test that play() on an element that doesn't have enough data will
     // return a promise that resolves successfully.
     function playBeforeCanPlay(t, audio) {
-        audio.src = "content/test.oga";
+        audio.src = findMediaFile("audio", "content/test");
         assert_equals(audio.readyState, HTMLMediaElement.HAVE_NOTHING);
         playExpectingResolvedPromise(t, audio);
     },
@@ -21,7 +22,7 @@
     // Test that play() on an element that has enough data will return a
     // promise that resolves successfully.
     function playWhenCanPlay(t, audio) {
-        audio.src = "content/test.oga";
+        audio.src = findMediaFile("audio", "content/test");
 
         audio.oncanplay = t.step_func(function() {
             assert_greater_than_equal(audio.readyState, HTMLMediaElement.HAVE_FUTURE_DATA);
@@ -34,7 +35,7 @@
     // promise that resolves successfully.
     function playAfterPlaybackStarted(t, audio) {
         audio.preload = "auto";
-        audio.src = "content/test.oga";
+        audio.src = findMediaFile("audio", "content/test");
 
         audio.onplaying = t.step_func(function() {
             assert_equals(audio.readyState, HTMLMediaElement.HAVE_ENOUGH_DATA);
@@ -50,7 +51,7 @@
     // Test that play() on an element with an unsupported content will
     // return a rejected promise.
     function playNotSupportedContent(t, audio) {
-        audio.src = "data:,.oga";
+        audio.src = findMediaFile("audio", "data:,");
 
         audio.onerror = t.step_func(function() {
             assert_true(audio.error instanceof MediaError);
@@ -64,7 +65,7 @@
     // This test doesn't test a spec behaviour but tests that the Blink
     // implementation properly changed after the spec changed.
     function playDecodeError(t, audio) {
-        audio.src = "content/test.oga";
+        audio.src = findMediaFile("audio", "content/test");
 
         audio.onerror = t.step_func(function() {
             assert_true(audio.error instanceof MediaError);
@@ -83,7 +84,7 @@
     // This test doesn't test a spec behaviour but tests that the Blink
     // implementation properly changed after the spec changed
     function playNetworkError(t, audio) {
-        audio.src = "content/test.oga";
+        audio.src = findMediaFile("audio", "content/test");
 
         audio.onerror = t.step_func(function() {
             assert_true(audio.error instanceof MediaError);
@@ -100,7 +101,7 @@
     // Test that play() returns a rejected promise if the element is
     // sufferring from a not supported error.
     function playWithErrorAlreadySet(t, audio) {
-        audio.src = "data:,.oga";
+        audio.src = findMediaFile("audio", "data:,");
 
         audio.onerror = t.step_func(function() {
             assert_true(audio.error instanceof MediaError);
@@ -112,12 +113,12 @@
     // Test that play() returns a resolved promise if the element had its
     // source changed after suffering from an error.
     function playSrcChangedAfterError(t, audio) {
-        audio.src = "data:,.oga";
+        audio.src = findMediaFile("audio", "data:,");
 
         audio.onerror = t.step_func(function() {
             assert_true(audio.error instanceof MediaError);
             assert_equals(audio.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
-            audio.src = "content/test.oga";
+            audio.src = findMediaFile("audio", "content/test");
 
             audio.onloadedmetadata = t.step_func(function() {
                 playExpectingResolvedPromise(t, audio);
@@ -128,12 +129,12 @@
     // Test that play() returns a rejected promise if the element had an
     // error and just changed its source.
     function playRaceWithSrcChangeError(t, audio) {
-        audio.src = "data:,.oga";
+        audio.src = findMediaFile("audio", "data:,");
 
         audio.onerror = t.step_func(function() {
             assert_true(audio.error instanceof MediaError);
             assert_equals(audio.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
-            audio.src = "content/test.oga";
+            audio.src = findMediaFile("audio", "content/test");
             assert_equals(audio.error, null);
             assert_equals(audio.readyState, HTMLMediaElement.HAVE_NOTHING);
             playExpectingResolvedPromise(t, audio);
@@ -145,7 +146,7 @@
     // words, pause() doesn't cancel play() because it was resolved
     // immediately.
     function playAndPauseWhenCanplay(t, audio) {
-        audio.src = "content/test.oga";
+        audio.src = findMediaFile("audio", "content/test");
 
         audio.oncanplaythrough = t.step_func(function() {
             assert_equals(audio.readyState, HTMLMediaElement.HAVE_ENOUGH_DATA);
@@ -178,13 +179,13 @@
     // Test that changing the src rejects the pending play() promises.
     function newSrcRejectPendingPromises(t, audio) {
         playExpectingRejectedPromise(t, audio, "AbortError"); // the promise will be left pending.
-        audio.src = "content/test.oga";
+        audio.src = findMediaFile("audio", "content/test");
     },
 
     // Test ordering of events and promises.
     // This is testing a bug in Blink, see https://crbug.com/587871
     function testEventAndPromiseOrdering(t, audio) {
-        audio.src = "data:,.oga";
+        audio.src = findMediaFile("audio", "data:,");
 
         audio.onerror = t.step_func(function() {
             // Until https://crbug.com/587871 is fixed, the events will be
@@ -207,7 +208,7 @@
     // playing returns a promise that resolves successfully.
     function pausePlayAfterPlaybackStarted(t, audio) {
         audio.preload = "auto";
-        audio.src = "content/test.oga";
+        audio.src = findMediaFile("audio", "content/test");
 
         audio.onplaying = t.step_func(function() {
             assert_equals(audio.readyState, HTMLMediaElement.HAVE_ENOUGH_DATA);
@@ -224,11 +225,11 @@
     // Test that running the load algorithm will not drop all the promises about
     // to be resolved.
     function loadAlgorithmDoesNotCancelTasks(t, audio) {
-        audio.src = 'content/test.oga';
+        audio.src = findMediaFile('audio', 'content/test');
         audio.addEventListener('canplaythrough', t.step_func(function() {
             // The play() promise will be queued to be resolved.
             playExpectingResolvedPromise(t, audio);
-            audio.src = 'content/test.oga';
+            audio.src = findMediaFile('audio', 'content/test');
             assert_true(audio.paused);
         }));
     },
@@ -238,7 +239,7 @@
     function loadAlgorithmKeepPromisesPendingWhenNotPausing(t, audio) {
         playExpectingResolvedPromise(t, audio);
         setTimeout(t.step_func(function() {
-            audio.src = 'content/test.oga';
+            audio.src = findMediaFile('audio', 'content/test');
             assert_false(audio.paused);
         }), 0);
     },
@@ -246,7 +247,7 @@
     // Test that when the load algorithm is run, if it resolves multiple
     // promises, they are resolved in the order in which they were added.
     function loadAlgorithmResolveOrdering(t, audio) {
-        audio.src = 'content/test.oga';
+        audio.src = findMediaFile('audio', 'content/test');
         audio.addEventListener('canplaythrough', t.step_func(function() {
             var firstPromiseResolved = false;
             audio.play().then(t.step_func(_ => firstPromiseResolved = true),
@@ -256,7 +257,7 @@
                 assert_true(firstPromiseResolved);
             }), t.unreached_func());
 
-            audio.src = 'content/test.oga';
+            audio.src = findMediaFile('audio', 'content/test');
         }));
     },
 
@@ -268,14 +269,14 @@
     // function loadAlgorithmKeepPromisesPendingWhenNotPausingAndPreloadNone(t, audio) {
     //     audio.preload = 'none';
     //     playExpectingRejectedPromise(t, audio, 'AbortError');
-    //     setTimeout(_ => audio.src = 'content/test.oga', 0);
+    //     setTimeout(_ => audio.src = findMediaFile('audio', 'content/test'), 0);
     // },
 
     // Test that when the load algorithm is run, if it does pause the playback,
     // it will reject the pending promises.
     function loadAlgorithmRejectPromisesWhenPausing(t, audio) {
         playExpectingRejectedPromise(t, audio, 'AbortError');
-        audio.src = 'content/test.oga';
+        audio.src = findMediaFile('audio', 'content/test');
         assert_true(audio.paused);
     },
 
@@ -284,7 +285,7 @@
     function loadAlgorithmRejectPromisesWhenPausingAndPreloadNone(t, audio) {
         audio.preload = 'none';
         playExpectingRejectedPromise(t, audio, 'AbortError');
-        audio.src = 'content/test.oga';
+        audio.src = findMediaFile('audio', 'content/test');
         assert_true(audio.paused);
     },
 
@@ -308,7 +309,7 @@
 
         setTimeout(t.step_func(function() {
             audio.pause();
-            audio.src = 'content/test.oga';
+            audio.src = findMediaFile('audio', 'content/test');
         }), 0);
     },
 ];
@@ -325,14 +326,14 @@
     // Test that play() on an element when media playback requires a gesture
     // returns a resolved promise if there is a user gesture.
     function playRequiresUserGestureAndHasIt(t, audio) {
-        audio.src = "content/test.oga";
+        audio.src = findMediaFile("audio", "content/test");
         playWithUserGesture(t, audio);
     },
 
     // Test that play() on an element when media playback requires a gesture
     // returns a rejected promise if there is no user gesture.
     function playRequiresUserGestureAndDoesNotHaveIt(t, audio) {
-        audio.src = "content/test.oga";
+        audio.src = findMediaFile("audio", "content/test");
         playExpectingRejectedPromise(t, audio, "NotAllowedError");
     }
 ];
diff --git a/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html b/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html
index f960da8..d2cef33 100644
--- a/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html
+++ b/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html
@@ -2,6 +2,7 @@
 <title>Test that a media element doesn't reload on removing the current source element and inserting a new source element.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <audio></audio>
 <script>
 async_test(function(t) {
@@ -18,9 +19,9 @@
     });
 
     var sourceA = document.createElement("source");
-    sourceA.src = "content/test.oga";
+    sourceA.src = findMediaFile("audio", "content/test");
     var sourceB = document.createElement("source");
-    sourceB.src = "content/silence.oga";
+    sourceB.src = findMediaFile("audio", "content/silence");
     audio.appendChild(sourceA);
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html b/third_party/WebKit/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html
index 48fe3da..f2eaae0 100644
--- a/third_party/WebKit/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html
+++ b/third_party/WebKit/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html
@@ -2,6 +2,7 @@
 <title>Test that media autoplay should not work if user gesture is required for playback.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
 internals.settings.setAutoplayPolicy('user-gesture-required');
 </script>
@@ -9,7 +10,7 @@
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     assert_true(video.paused);
 
     video.onplay = t.unreached_func();
diff --git a/third_party/WebKit/LayoutTests/media/play-promise-crash.html b/third_party/WebKit/LayoutTests/media/play-promise-crash.html
index da5cf53e..9e23035 100644
--- a/third_party/WebKit/LayoutTests/media/play-promise-crash.html
+++ b/third_party/WebKit/LayoutTests/media/play-promise-crash.html
@@ -6,12 +6,13 @@
 <body>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
   window.internals.settings.setAutoplayPolicy('user-gesture-required');
 
   async_test(function(t) {
     var video = document.createElement('video');
-    video.src = 'content/test.ogv';
+    video.src = findMediaFile('video', 'content/test');
     video.play().then(t.step_func_done(function() {
       assert_unreached();
     }), t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/remoteplayback/availability-callback-gc.html b/third_party/WebKit/LayoutTests/media/remoteplayback/availability-callback-gc.html
index 1c28408..c4135ae 100644
--- a/third_party/WebKit/LayoutTests/media/remoteplayback/availability-callback-gc.html
+++ b/third_party/WebKit/LayoutTests/media/remoteplayback/availability-callback-gc.html
@@ -5,13 +5,14 @@
         <script src="../../resources/testharness.js"></script>
         <script src="../../resources/testharnessreport.js"></script>
         <script src="../../resources/gc.js"></script>
-            </head>
+        <script src="../media-file.js"></script>
+    </head>
     <body>
         <script>
             async_test(function(t)
             {
                 var v = document.createElement('video');
-                v.src = '../content/test.ogv';
+                v.src = findMediaFile('video', '../content/test');
                 document.body.appendChild(v);
 
                 function callback(available) {}
diff --git a/third_party/WebKit/LayoutTests/media/remoteplayback/prompt-twice-throws.html b/third_party/WebKit/LayoutTests/media/remoteplayback/prompt-twice-throws.html
index 3abd9429..1f363b9 100644
--- a/third_party/WebKit/LayoutTests/media/remoteplayback/prompt-twice-throws.html
+++ b/third_party/WebKit/LayoutTests/media/remoteplayback/prompt-twice-throws.html
@@ -4,7 +4,8 @@
         <title>Test that calling prompt() before the promise returned by the previous call is resolved throws an exception</title>
         <script src="../../resources/testharness.js"></script>
         <script src="../../resources/testharnessreport.js"></script>
-                <script src="util.js"></script>
+        <script src="../media-file.js"></script>
+        <script src="util.js"></script>
     </head>
     <body>
         <button id="button">Click me</button>
@@ -28,7 +29,7 @@
                 enableRemotePlaybackBackendForTest(test);
 
                 var v = document.createElement('video');
-                v.src = '../content/test.ogv';
+                v.src = findMediaFile('video', '../content/test');
                 document.body.appendChild(v);
 
                 var btn = document.getElementById('button');
diff --git a/third_party/WebKit/LayoutTests/media/remoteplayback/watch-availability-throws-low-end-device.html b/third_party/WebKit/LayoutTests/media/remoteplayback/watch-availability-throws-low-end-device.html
index 7c03647..60d46036 100644
--- a/third_party/WebKit/LayoutTests/media/remoteplayback/watch-availability-throws-low-end-device.html
+++ b/third_party/WebKit/LayoutTests/media/remoteplayback/watch-availability-throws-low-end-device.html
@@ -4,7 +4,8 @@
         <title>Test that watchAvailability() throws on low-end devices.</title>
         <script src="../../resources/testharness.js"></script>
         <script src="../../resources/testharnessreport.js"></script>
-                <script src="util.js"></script>
+        <script src="../media-file.js"></script>
+        <script src="util.js"></script>
     </head>
     <body>
         <script>
@@ -14,7 +15,7 @@
             {
                 enableRemotePlaybackBackendForTest(t);
                 var v = document.createElement('video');
-                v.src = '../content/test.ogv';
+                v.src = findMediaFile('video', '../content/test');
                 document.body.appendChild(v);
                 internals.setIsLowEndDevice(true);
                 v.remote.watchAvailability(t.unreached_func()).then(
diff --git a/third_party/WebKit/LayoutTests/media/remove-from-document.html b/third_party/WebKit/LayoutTests/media/remove-from-document.html
index a4a29d9..756b09f 100644
--- a/third_party/WebKit/LayoutTests/media/remove-from-document.html
+++ b/third_party/WebKit/LayoutTests/media/remove-from-document.html
@@ -2,11 +2,12 @@
 <title>Test that removing a media element from the tree pauses playback but does not unload the media.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video autoplay></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 
     video.oncanplaythrough = t.step_func_done(function() {
         assert_not_equals(video.networkState, HTMLMediaElement.NETWORK_EMPTY);
diff --git a/third_party/WebKit/LayoutTests/media/resources/video-stop-propagation.html b/third_party/WebKit/LayoutTests/media/resources/video-stop-propagation.html
index a92a8c0..c8342f7 100644
--- a/third_party/WebKit/LayoutTests/media/resources/video-stop-propagation.html
+++ b/third_party/WebKit/LayoutTests/media/resources/video-stop-propagation.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <html>
+<script src="../media-file.js"></script>
 <!--Padding ensures the overflow menu is visible for the tests. -->
 <body style="padding-top: 100px; padding-left: 100px">
 <video controls width=60></video>
@@ -7,7 +8,7 @@
 <script>
   // Set up video
   var video = document.querySelector("video");
-  video.src = "../content/test.ogv";
+  video.src = findMediaFile("video", "../content/test");
   // Add captions
   var track = video.addTextTrack("captions");
 
diff --git a/third_party/WebKit/LayoutTests/media/seek-to-currentTime.html b/third_party/WebKit/LayoutTests/media/seek-to-currentTime.html
index e657ba6..d329178 100644
--- a/third_party/WebKit/LayoutTests/media/seek-to-currentTime.html
+++ b/third_party/WebKit/LayoutTests/media/seek-to-currentTime.html
@@ -3,12 +3,13 @@
 <title>seek to currentTime</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <div id=log></div>
 <script>
 // TODO(srirama.m): Remove this test by importing the above web-platform-tests test
 async_test(function(t) {
     var v = document.createElement('video');
-    v.src = 'content/test.ogv';
+    v.src = findMediaFile('video', 'content/test');
     v.onloadedmetadata = t.step_func(function() {
         assert_greater_than(v.readyState, v.HAVE_NOTHING, 'readyState');
         assert_greater_than(v.seekable.length, 0, 'seekable ranges');
diff --git a/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable-expected.html b/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable-expected.html
index 97b8d00..320cde41 100644
--- a/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable-expected.html
+++ b/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable-expected.html
@@ -27,7 +27,7 @@
 
         function init()
         {
-            setSrcByTagName("video", "../content/test.ogv");
+            setSrcByTagName("video", findMediaFile("video", "../content/test"));
 
             var totalCount = document.getElementsByTagName('video').length;
             var count = totalCount;
diff --git a/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable.html b/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable.html
index 696bf68..c51976a 100644
--- a/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable.html
+++ b/third_party/WebKit/LayoutTests/media/stable/video-object-fit-stable.html
@@ -18,7 +18,7 @@
 
         function init()
         {
-            setSrcByTagName("video", "../content/test.ogv");
+            setSrcByTagName("video", findMediaFile("video", "../content/test"));
 
             var totalCount = document.getElementsByTagName('video').length;
             var count = totalCount;
diff --git a/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow-2.html b/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow-2.html
index c7ba4dec24..3f12558 100644
--- a/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow-2.html
+++ b/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow-2.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that the cue is styled when video and style is in the same shadow tree.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -12,7 +13,7 @@
     shadowRoot.innerHTML = '<style>video::cue(.red, .red2) { color:red } video::cue(.green) { color:green }</style>'
         + '<video controls ><track src="captions-webvtt/styling-lifetime.vtt" kind="captions" default></video>';
     var video = shadowRoot.querySelector('video');
-    video.src = '../content/test.ogv';
+    video.src = findMediaFile('video', '../content/test');
     video.id = "testvideo";
     video.onseeked = t.step_func_done(function() {
         var cueNode = textTrackCueElementByIndex(video, 0).firstChild.firstElementChild;
diff --git a/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html b/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html
index edd6b1aa..35279e2 100644
--- a/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html
+++ b/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that the cue is not styled when video is in a shadow tree and style is in a document.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -15,7 +16,7 @@
     var shadowRoot = host.createShadowRoot();
     shadowRoot.innerHTML = '<video controls ><track src="captions-webvtt/styling-lifetime.vtt" kind="captions" default></video>';
     var video = shadowRoot.querySelector('video');
-    video.src = '../content/test.ogv';
+    video.src = findMediaFile('video', '../content/test');
     video.id = "testvideo";
     video.onseeked = t.step_func_done(function() {
         var cueNode = textTrackCueElementByIndex(video, 0).firstChild.firstElementChild;
diff --git a/third_party/WebKit/LayoutTests/media/track/cue-style-invalidation.html b/third_party/WebKit/LayoutTests/media/track/cue-style-invalidation.html
index 903aa070..d29b02d0 100644
--- a/third_party/WebKit/LayoutTests/media/track/cue-style-invalidation.html
+++ b/third_party/WebKit/LayoutTests/media/track/cue-style-invalidation.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Check that descendant style invalidation works with ::cue selectors.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -22,7 +23,7 @@
 <script>
 async_test(function(t) {
     var video = document.querySelector('video');
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
     video.onseeked = t.step_func_done(function() {
         var red = "rgb(255, 0, 0)";
         var green = "rgb(0, 128, 0)";
diff --git a/third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-crash.html b/third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-crash.html
index 1050637d..561f98d 100644
--- a/third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-crash.html
+++ b/third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-crash.html
@@ -3,6 +3,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../../resources/gc.js"></script>
+<script src="../media-file.js"></script>
 <video autoplay>
     <track src="captions-webvtt/captions-fast.vtt" default>
 </video>
@@ -20,7 +21,7 @@
 
     function CFcrash() {
         var video = document.querySelector("video");
-        video.src = "content/test.ogv";
+        video.src = findMediaFile("video", "content/test");
         var document1 = document.implementation.createDocument("", null);
         document1.appendChild(video);
         delete document1;
diff --git a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-display.html b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-display.html
index 48d37a0..33b3243 100644
--- a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-display.html
+++ b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-display.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <title>Tests default rendering for TextTrackCues that belong to a VTTRegion.</title>
 <script src="../../media-controls.js"></script>
+<script src="../../media-file.js"></script>
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
 <video controls></video>
@@ -32,7 +33,7 @@
 
 async_test(function() {
     var video = document.querySelector('video');
-    video.src = '../../content/test.ogv';
+    video.src = findMediaFile('video', '../../content/test');
     var testTrack = document.createElement('track');
     testTrack.onload = this.step_func(function() {
         video.oncanplaythrough = this.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout.html b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout.html
index 3969a0f..f37ecd64 100644
--- a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout.html
+++ b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout.html
@@ -1,12 +1,13 @@
 <!DOCTYPE html>
 <title>Tests default DOM layout structure for a VTTRegion.</title>
 <script src="../../media-controls.js"></script>
+<script src="../../media-file.js"></script>
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
 <script>
 async_test(function() {
     var video = document.createElement('video');
-    video.src = '../../content/test.ogv';
+    video.src = findMediaFile('video', '../../content/test');
     var testTrack = document.createElement('track');
     testTrack.onload = this.step_func(function() {
         video.oncanplaythrough = this.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-non-visible-crash.html b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-non-visible-crash.html
index 8428b7f..c5dc3e3 100644
--- a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-non-visible-crash.html
+++ b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-non-visible-crash.html
@@ -2,11 +2,12 @@
 <title>Box-less VTTCue attached to VTTRegion should not crash</title>
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
+<script src="../../media-file.js"></script>
 <video></video>
 <script>
 setup(function() {
   window.video = document.querySelector('video');
-  video.src = '../../content/test.ogv';
+  video.src = findMediaFile('video', '../../content/test');
 });
 async_test(function(t) {
   let track = video.addTextTrack('subtitles');
diff --git a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html
index be3e2f6..f27add7 100644
--- a/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html
+++ b/third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Tests proper parsing of various regions present in WebVTT header area.</title>
+<script src="../../media-file.js"></script>
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
 <script>
@@ -34,7 +35,7 @@
 
 async_test(function(t) {
     var video = document.createElement('video');
-    video.src = '../../content/test.ogv';
+    video.src = findMediaFile('video', '../../content/test');
     var testTrack = document.createElement('track');
     testTrack.onload = t.step_func_done(function() {
         var track = testTrack.track;
diff --git a/third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-add-track.html b/third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-add-track.html
index 63cf1d80..c62e8d3 100644
--- a/third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-add-track.html
+++ b/third_party/WebKit/LayoutTests/media/track/text-track-selection-menu-add-track.html
@@ -2,6 +2,7 @@
 <title>Test that we can add a track dynamically and it is displayed on the track selection menu.</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <!-- Width should be large enough to display closed captions button. -->
 <video controls style="width: 500px">
@@ -30,6 +31,6 @@
         assert_equals(textTrackDisplayElement(video).innerText, trackCueText);
     });
 
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 })
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-all-cues.html b/third_party/WebKit/LayoutTests/media/track/track-css-all-cues.html
index dc12ee7..5199bab 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-css-all-cues.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-css-all-cues.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that style to all cues is applied correctly.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -18,8 +19,8 @@
 <script>
 async_test(function(t) {
     var video = document.querySelector('video');
-    video.src = '../content/test.ogv';
-
+    video.src = findMediaFile('video', '../content/test');
+    
     var track = document.createElement('track');
     track.src = 'captions-webvtt/styling.vtt';
     track.kind = 'captions';
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-cue-lifetime.html b/third_party/WebKit/LayoutTests/media/track/track-css-cue-lifetime.html
index f7e503c6..e7f2b7a5 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-css-cue-lifetime.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-css-cue-lifetime.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that the cue is styled properly throughout its lifetime.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -14,9 +15,9 @@
     var step = 0.4;
     var initialTime = 0.6;
     var endTime = 3.0
-
+    
     var video = document.querySelector('video');
-    video.src = '../content/test.ogv';
+    video.src = findMediaFile('video', '../content/test');
 
     var track = document.createElement('track');
     track.src = 'captions-webvtt/styling-lifetime.vtt';
@@ -38,7 +39,7 @@
         else
             video.currentTime = seekTime;
     });
-
+    
     video.currentTime = initialTime;
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-matching-default.html b/third_party/WebKit/LayoutTests/media/track/track-css-matching-default.html
index d5cb191..7742217 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-css-matching-default.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-css-matching-default.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that u, b, i WebVTT objects are being styled correctly.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -7,8 +8,8 @@
 <script>
 async_test(function(t) {
     var video = document.querySelector('video');
-    video.src = '../content/test.ogv';
-
+    video.src = findMediaFile('video', '../content/test');
+    
     var track = document.createElement('track');
     track.src = 'captions-webvtt/styling-default.vtt';
     track.kind = 'captions';
@@ -23,7 +24,7 @@
         cueNode = cueNode.nextElementSibling;
         assert_equals(getComputedStyle(cueNode).textDecoration, 'underline solid rgb(255, 255, 255)');
     });
-
+    
     video.currentTime = 0.1;
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-matching-lang.html b/third_party/WebKit/LayoutTests/media/track/track-css-matching-lang.html
index 0ee9681..60629f06 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-css-matching-lang.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-css-matching-lang.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that cues are being matched properly by the lang attribute and :lang() pseudo class.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -12,8 +13,8 @@
 <script>
 async_test(function(t) {
     var video = document.querySelector('video');
-    video.src = '../content/test.ogv';
-
+    video.src = findMediaFile('video', '../content/test');
+    
     var track = document.createElement('track');
     track.src = 'captions-webvtt/styling-lang.vtt';
     track.kind = 'captions';
@@ -28,7 +29,7 @@
         cueNode = cueNode.firstElementChild.firstElementChild;
         assert_equals(getComputedStyle(cueNode).color, 'rgb(128, 0, 128)');
     });
-
+    
     video.currentTime = 0.1;
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-matching-timestamps.html b/third_party/WebKit/LayoutTests/media/track/track-css-matching-timestamps.html
index 8e89355..c9fb1a2 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-css-matching-timestamps.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-css-matching-timestamps.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that cues are being matched properly by :past and :future pseudo classes.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -19,10 +20,10 @@
                 ["rgb(0, 255, 0)", "rgb(0, 255, 0)", "rgb(128, 128, 128)", "rgb(128, 128, 128)", "rgb(128, 128, 128)"],
                 ["rgb(0, 255, 0)", "rgb(0, 255, 0)", "rgb(0, 255, 0)", "rgb(128, 128, 128)", "rgb(0, 255, 0)"],
                 ["rgb(0, 255, 0)", "rgb(0, 255, 0)", "rgb(0, 255, 0)", "rgb(0, 255, 0)", "rgb(0, 255, 0)"]];
-
+            
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
-
+    video.src = findMediaFile("video", "../content/test");
+    
     var track = document.createElement("track");
     track.src = "captions-webvtt/styling-timestamps.vtt";
     track.kind = "captions";
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-matching.html b/third_party/WebKit/LayoutTests/media/track/track-css-matching.html
index d14b56f8..77e8759f 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-css-matching.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-css-matching.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that cues are being matched properly by various CSS Selectors.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -29,8 +30,8 @@
                 ["rgb(255, 255, 0)", "rgb(255, 0, 0)", "rgb(0, 128, 0)"]];
 
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
-
+    video.src = findMediaFile("video", "../content/test");
+    
     var track = document.createElement("track");
     track.src = "captions-webvtt/styling.vtt";
     track.kind = "captions";
@@ -51,7 +52,7 @@
         else
             video.currentTime = seekTimes[seekTimeIndex];
     });
-
+    
     video.currentTime = seekTimes[seekTimeIndex];
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-property-whitelist.html b/third_party/WebKit/LayoutTests/media/track/track-css-property-whitelist.html
index d3fd1057..b2a45b3 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-css-property-whitelist.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-css-property-whitelist.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that ::cue pseudo-element properties are applied to WebVTT node objects only.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -18,7 +19,7 @@
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     video.onseeked = t.step_func_done(function() {
         var cueNode = textTrackCueElementByIndex(video, 0).firstChild.firstElementChild;
@@ -26,13 +27,13 @@
         assert_equals(cueStyle.color, "rgb(255, 0, 0)");
         assert_equals(cueStyle.padding, "0px");
         assert_equals(cueStyle.wordSpacing, "0px");
-
+        
         cueNode = cueNode.nextElementSibling;
         cueStyle = getComputedStyle(cueNode);
         assert_equals(cueStyle.color, "rgb(255, 0, 0)");
         assert_equals(cueStyle.padding, "0px");
         assert_equals(cueStyle.wordSpacing, "0px");
-
+        
         cueNode = cueNode.nextElementSibling;
         cueStyle = getComputedStyle(cueNode);
         assert_equals(cueStyle.color, "rgb(255, 0, 0)");
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-author-settings.html b/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-author-settings.html
index 52dad36..1ab12b12 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-author-settings.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-author-settings.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that WebVTT objects are being styled correctly based on user settings that should override author settings.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -21,7 +22,7 @@
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     video.oncanplaythrough = t.step_func_done(function() {
         var cue = textTrackCueElementByIndex(video, 0).firstChild.firstElementChild;
@@ -33,7 +34,7 @@
         assert_equals(cueStyle.fontFamily, "arial");
         assert_equals(cueStyle.fontStyle, "normal");
         assert_equals(cueStyle.fontVariant, "normal");
-
+        
         // Apply user settings and verify they override author-specified settings
         internals.settings.setTextTrackTextColor("cyan");
         internals.settings.setTextTrackBackgroundColor("green");
@@ -42,7 +43,7 @@
         internals.settings.setTextTrackFontFamily("fantasy");
         internals.settings.setTextTrackFontStyle("italic");
         internals.settings.setTextTrackFontVariant("small-caps");
-
+        
         video.currentTime = 0.3;
 
         cue = textTrackCueElementByIndex(video, 0).firstChild.firstElementChild;
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-internal-settings.html b/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-internal-settings.html
index 5627716..cde58678 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-internal-settings.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-css-user-settings-override-internal-settings.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that WebVTT objects are being styled correctly based on user settings that should override default settings.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -9,7 +10,7 @@
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     video.oncanplaythrough = t.step_func_done(function() {
         var cue = textTrackCueElementByIndex(video, 0).firstChild;
@@ -19,7 +20,7 @@
         assert_equals(cueStyle.color, "rgb(255, 255, 255)");
         assert_equals(cueStyle.backgroundColor, "rgba(0, 0, 0, 0.8)");
         assert_equals(cueStyle.fontFamily, "sans-serif");
-
+        
         // Apply user settings for color and font-size and verify that the other internal settings are retained.
         internals.settings.setTextTrackTextColor("purple");
         internals.settings.setTextTrackTextSize("14px");
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-container-rendering-position.html b/third_party/WebKit/LayoutTests/media/track/track-cue-container-rendering-position.html
index 2aa5188..0bde8e03 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-container-rendering-position.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-container-rendering-position.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>The top of the text track container should be in the bottom 25% of the video element.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -14,8 +15,8 @@
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
-
+    video.src = findMediaFile("video", "../content/test");
+    
     video.oncanplaythrough = t.step_func_done(function() {
         var cueDisplayElement = textTrackDisplayElement(video);
         document.body.offsetTop; // Force layout.
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-gc-wrapper.html b/third_party/WebKit/LayoutTests/media/track/track-cue-gc-wrapper.html
index 6f4f286..96ed4cf 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-gc-wrapper.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-gc-wrapper.html
@@ -2,13 +2,14 @@
 <title>Tests that added cue object wrappers live across garbage collections.</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var cueIndex = 0;
     var cueLimit = 10;
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     video.textTracks.custom = "trackList";
     assert_true(video.textTracks.hasOwnProperty("custom"));
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html
index cb6f355b..e872421d4 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that cue fragment is mutable.</title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <style>
@@ -80,6 +81,6 @@
         fragment.appendChild(document.createTextNode(" amet,"));
     }
 
-    video.src = "../content/counting.ogv";
+    video.src = findMediaFile("video", "../content/counting");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text.html b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text.html
index 6f91344..63363f7 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that cue text is mutable.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -67,6 +68,6 @@
         t.done();
     }
 
-    video.src = "../content/counting.ogv";
+    video.src = findMediaFile("video", "../content/counting");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-nothing-to-render.html b/third_party/WebKit/LayoutTests/media/track/track-cue-nothing-to-render.html
index 1c1c4054..5574fa9 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-nothing-to-render.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-nothing-to-render.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that cues are rendered and removed.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -10,8 +11,8 @@
 async_test(function(t) {
     var video = document.querySelector("video");
     var testTrack = document.querySelector("track");
-    video.src = "../content/counting.ogv";
-
+    video.src = findMediaFile("video", "../content/counting");
+    
     var seekTimeIndex = 0;
     var info = [
         0.5, "",
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-empty-cue-crash.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-empty-cue-crash.html
index 48e6174..2f29c82a 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-empty-cue-crash.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-empty-cue-crash.html
@@ -1,11 +1,12 @@
 <!DOCTYPE html>
 <title>Tests that having empty cues does not crash the browser.</title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script>
 test(function() {
     var video = document.createElement("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
     video.addTextTrack("captions", "regular captions track", "en");
     video.textTracks[0].addCue(new VTTCue(0, 4, ""));
     video.play();
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-first-line-box.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-first-line-box.html
index 80e3dee..cd865158 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-first-line-box.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-first-line-box.html
@@ -3,12 +3,13 @@
 <style>
 -webkit-media-text-track-display { display: block; }
 </style>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script>
 test(function() {
     var video = document.createElement("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
     video.addTextTrack("captions", "regular captions track", "en");
     video.textTracks[0].addCue(new VTTCue(0, 4, ""));
     video.play();
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-horizontal.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-horizontal.html
index c68f49a..258e7cd8a 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-horizontal.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-horizontal.html
@@ -1,11 +1,12 @@
 <!DOCTYPE html>
 <title>Test, rendering horizontal line-positioned cues.</title>
+<script src="../media-file.js"></script>
 <video>
     <track src="captions-webvtt/captions-snap-to-lines-set.vtt" kind="captions" default>
 </video>
 <script>
 var video = document.querySelector("video");
-video.src = "../content/test.ogv";
+video.src = findMediaFile("video", "../content/test");
 
 testRunner.waitUntilDone();
 video.onseeked = function() {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit-expected.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit-expected.html
index f8bbc33..53e7d28 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit-expected.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit-expected.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
+<script src="../media-file.js"></script>
 <script>
-var mediaFile = '../content/test.ogv';
+var mediaFile = findMediaFile('video', '../content/test');
 </script>
 <style>
 .container {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit.html
index 8628435..a91f8ce 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-line-doesnt-fit.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
+<script src="../media-file.js"></script>
 <script>
-var mediaFile = '../content/test.ogv';
+var mediaFile = findMediaFile('video', '../content/test');
 
 function addCue(track, cueData) {
   var cue = new VTTCue(0, 10, 'XXX');
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-mode-changed.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-mode-changed.html
index 20c2804a..e5fb2fd 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-mode-changed.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-mode-changed.html
@@ -1,12 +1,13 @@
 <!DOCTYPE html>
 <title>Test that cues are rendered when only the track mode is changed.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script>
 async_test(function(t) {
     var video = document.createElement('video');
-    video.src = '../content/test.ogv';
+    video.src = findMediaFile('video', '../content/test');
 
     video.oncanplaythrough = t.step_func_done(function() {
         addTracks();
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-on-resize.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-on-resize.html
index ab656ed..1e11ad51 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-on-resize.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-on-resize.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that line height of cue element isn't overridden by author CSS.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -12,7 +13,7 @@
 <script>
 async_test(function(t) {
     var video = document.querySelector('video');
-    video.src = '../content/test.ogv';
+    video.src = findMediaFile('video', '../content/test');
 
     video.onseeked = t.step_func_done(function() {
         var multiLineCueDisplayElement = textTrackDisplayElement(video);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-overscan.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-overscan.html
index de9b4ad..738a45f3 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-overscan.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-overscan.html
@@ -1,5 +1,6 @@
 <!doctype html>
 <title>WebVTT overscan margin test</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -20,7 +21,7 @@
       video.appendChild(track);
       document.body.appendChild(video);
 
-      video.src = '../content/test.ogv';
+      video.src = findMediaFile('video', '../content/test');
       video.oncanplaythrough = function() { video.currentTime = time; };
       video.onseeked = t.step_func(function() {
         var testCueDisplayBox = textTrackDisplayElement(video);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-expected.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-expected.html
index 901df80ac..40ba315 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-expected.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-expected.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
+<script src="../media-file.js"></script>
 <script>
-var mediaFile = '../content/test.ogv';
+var mediaFile = findMediaFile('video', '../content/test');
 </script>
 <style>
 .container {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl-expected.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl-expected.html
index 0654db4..3971674 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl-expected.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl-expected.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
+<script src="../media-file.js"></script>
 <script>
-var mediaFile = '../content/test.ogv';
+var mediaFile = findMediaFile('video', '../content/test');
 </script>
 <style>
 .container {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl.html
index 10f7c4d..c688b91 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto-rtl.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
+<script src="../media-file.js"></script>
 <script>
-var mediaFile = '../content/test.ogv';
+var mediaFile = findMediaFile('video', '../content/test');
 
 function addTrackWithRtlCueData(video, cueData) {
   var track = video.addTextTrack('subtitles');
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto.html
index 12d1911a..31d142f 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-position-auto.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
+<script src="../media-file.js"></script>
 <script>
-var mediaFile = '../content/test.ogv';
+var mediaFile = findMediaFile('video', '../content/test');
 
 function addTrackWithCueData(video, cueData) {
   var track = video.addTextTrack('subtitles');
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-rtl.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-rtl.html
index cba774f1..b832cd1 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-rtl.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-rtl.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <title>Test that directionality is set correctly on cues.</title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -11,7 +12,7 @@
 async_test(function(t) {
     var testTrack = document.querySelector("track");
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     var seekedCount = 0;
     var info = ["تجربة",
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-snap-to-lines-not-set.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-snap-to-lines-not-set.html
index d08e1f1..1b4e81dc 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-snap-to-lines-not-set.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-snap-to-lines-not-set.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that TextTrack's cues are rendered correctly when the snap to lines flag is not set.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -10,7 +11,7 @@
 async_test(function(t) {
     var video = document.querySelector("video");
     var testTrack = document.querySelector("track");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     // In Chromium it is the enclosure element, which provides the controls height, otherwise the panel;
     // both are the second child in the shadow DOM.
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video-expected.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video-expected.html
index 5be577f..722ccf9 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video-expected.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video-expected.html
@@ -1,4 +1,5 @@
 <!DOCTYPE html>
+<script src="../media-file.js"></script>
 <style>
 .container {
   transform: translate(1px, 0px);
@@ -26,7 +27,7 @@
 <div class="container">
   <video>
     <script>
-      document.currentScript.parentNode.src = '../content/test.ogv';
+      document.currentScript.parentNode.src = findMediaFile('video', '../content/test');
     </script>
   </video>
   <div class=video><div class="cue"><span>XXX</span></div></div>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video.html
index bcaa0e1..d359c55 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-transformed-video.html
@@ -1,4 +1,5 @@
 <!DOCTYPE html>
+<script src="../media-file.js"></script>
 <style>
 video {
   transform: translate(1px, 0px);
@@ -18,5 +19,5 @@
 cue.line = 0;
 track.addCue(cue);
 track.mode = 'showing';
-video.src = '../content/test.ogv';
+video.src = findMediaFile('video', '../content/test');
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html
index 52f74fd..bf8e92d 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Tests that the cue display tree has been removed properly and no crash happens.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -9,7 +10,7 @@
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     video.play();
     video.oncanplaythrough = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-vertical.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-vertical.html
index a37f060..8932baee 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-vertical.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-vertical.html
@@ -1,11 +1,12 @@
 <!DOCTYPE html>
 <title>Test, rendering vertical line-positioned cues with Japanese text.</title>
+<script src="../media-file.js"></script>
 <video>
     <track src="captions-webvtt/captions-snap-to-lines-set.vtt" kind="captions" default>
 </video>
 <script>
 var video = document.querySelector("video");
-video.src = "../content/test.ogv";
+video.src = findMediaFile("video", "../content/test");
 
 testRunner.waitUntilDone();
 video.onseeked = function() {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-wider-than-controls.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-wider-than-controls.html
index 82c10c2..4ac19e34 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-wider-than-controls.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-wider-than-controls.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that the cue root is not constrained by the controls/overlay.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -22,8 +23,8 @@
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
-
+    video.src = findMediaFile("video", "../content/test");
+    
     video.onseeked = t.step_func_done(function() {
         // The width of the controls depends on UA style, so verify that our assumption holds.
         var controlsContainer = mediaControlsButton(video, "panel");
@@ -32,7 +33,7 @@
         var cueRoot = textTrackContainerElement(video);
         assert_true(parseFloat(getComputedStyle(cueRoot).width) > 800);
     });
-
+    
     video.currentTime = 2;
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-with-padding.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-with-padding.html
index 9ccce45..27550f0 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-with-padding.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-with-padding.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Tests rendering text track cue line with padding set.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -14,7 +15,7 @@
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     video.onseeked = t.step_func_done(function() {
         var cueContainerElement = textTrackContainerElement(video);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering.html
index 8a20c33..a0eec76e 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that default positioned TextTrack's cues are rendered correctly.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -11,7 +12,7 @@
 async_test(function(t) {
     var video = document.querySelector("video");
     var testTrack = document.querySelector("track");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     var cueTextIndex = 0;
     var cueText = [ "Lorem", "ipsum", "dolor", "sit" ];
@@ -49,7 +50,7 @@
             }
         }));
     }
-
+    
     video.currentTime = 0.5;
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-cuechange.html b/third_party/WebKit/LayoutTests/media/track/track-cues-cuechange.html
index 49c0526..c0a85e3 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cues-cuechange.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cues-cuechange.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Tests that TextTrack's cues are indexed and updated in order during video playback. Test uses the cuechange event.</title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <video>
@@ -10,7 +11,7 @@
     var video = document.querySelector("video");
     var testTrack = document.querySelector("track");
 
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
     video.oncanplaythrough = t.step_func(attemptTests);
 
     function attemptTests() {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-enter-exit.html b/third_party/WebKit/LayoutTests/media/track/track-cues-enter-exit.html
index e973204..5c491b1e 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cues-enter-exit.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cues-enter-exit.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Tests that TextTrack's cues are indexed and updated in order during video playback. Test uses the enter and exits events on TextTrackCue.</title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <video>
@@ -10,8 +11,8 @@
     var video = document.querySelector("video");
     var testTrack = document.querySelector("track");
 
-    video.src = "../content/test.ogv";
-
+    video.src = findMediaFile("video", "../content/test");
+    
     video.oncanplaythrough = t.step_func(attemptTests);
 
     function attemptTests() {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-missed.html b/third_party/WebKit/LayoutTests/media/track/track-cues-missed.html
index 9510499f..40f2f75 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cues-missed.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cues-missed.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Tests that events are triggered for missed (skipped) cues during normal playback.</title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <video>
@@ -10,8 +11,8 @@
     var video = document.querySelector("video");
     var testTrack = document.querySelector("track");
 
-    video.src = "../content/test.ogv";
-
+    video.src = findMediaFile("video", "../content/test");
+    
     video.onended = t.step_func_done();
 
     video.oncanplaythrough = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html b/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html
index 46f6945..7cea266 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html
@@ -2,6 +2,7 @@
 <title>Tests that the video is paused after cues that have pause-on-exit flag are processed.</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <video controls>
     <track src="captions-webvtt/simple-captions.vtt" default>
 </video>
@@ -25,7 +26,7 @@
                 });
             }
         }
-        video.src = "../content/test.ogv";
+        video.src = findMediaFile("video", "../content/test");
         video.currentTime = 4.00;
         video.play();
         assert_false(video.paused);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html b/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html
index cc5fa9d..0cc4399 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html
@@ -2,6 +2,7 @@
 <title>Tests TextTrack's activeCues are indexed and updated during video playback.</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <video>
     <track src="captions-webvtt/cues-overlapping.vtt" kind="subtitles" default>
 </video>
@@ -11,7 +12,7 @@
     var track = document.querySelector("track");
     track.onload = t.step_func(function() {
         assert_equals(track.track.cues.length, 3);
-        video.src = "../content/test.ogv";
+        video.src = findMediaFile("video", "../content/test");
         video.currentTime = 0.5;
     });
 
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html b/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html
index 10cf7af..e602ee1 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html
@@ -2,13 +2,14 @@
 <title>Tests that all events are triggered in chronological order.</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <video>
     <track src="captions-webvtt/sorted-dispatch.vtt" default>
 </video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
     var track = document.querySelector("track");
 
     track.onload = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-delete-during-setup.html b/third_party/WebKit/LayoutTests/media/track/track-delete-during-setup.html
index 3e558dc..93e5763 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-delete-during-setup.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-delete-during-setup.html
@@ -2,6 +2,7 @@
 <title>Tests track deletion during setup.</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <video>
     <track src="captions-webvtt/metadata.vtt">
 </video>
@@ -23,6 +24,6 @@
     assert_equals(track.track.mode, "disabled");
     track.track.mode = "hidden";
 
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-disabled-addcue.html b/third_party/WebKit/LayoutTests/media/track/track-disabled-addcue.html
index 297556a..147eced 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-disabled-addcue.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-disabled-addcue.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test adding cues to a disabled text track. </title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script>
@@ -27,7 +28,7 @@
         t.done();
     });
 
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
     video.play();
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-disabled.html b/third_party/WebKit/LayoutTests/media/track/track-disabled.html
index df3423f..5b44aa8 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-disabled.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-disabled.html
@@ -3,6 +3,7 @@
 <video>
     <track kind="subtitles" src="captions-webvtt/captions.vtt"/>
 </video>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script>
@@ -22,7 +23,7 @@
           t.done();
     });
 
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
     video.play();
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-insert-after-load-crash.html b/third_party/WebKit/LayoutTests/media/track/track-insert-after-load-crash.html
index 51d146c6..7e2e95ff 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-insert-after-load-crash.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-insert-after-load-crash.html
@@ -1,11 +1,12 @@
 <!DOCTYPE  html>
 <title>Tests that inserting a track element immediately after a load() doesn't crash.</title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script>
 async_test(function(t) {
     var video = document.createElement('video');
-    video.src = '../content/test.ogv';
+    video.src = findMediaFile('video', '../content/test');
     video.load();
     video.appendChild(document.createElement('track'));
     video.onloadedmetadata = t.step_func_done();
diff --git a/third_party/WebKit/LayoutTests/media/track/track-kind-user-preference.html b/third_party/WebKit/LayoutTests/media/track/track-kind-user-preference.html
index 62bbfa9..c53f44c 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-kind-user-preference.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-kind-user-preference.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Test that user preference for text track kind is honored.</title>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
@@ -20,7 +21,7 @@
         internals.settings.setTextTrackKindUserPreference("default");
     });
     internals.setUserPreferredLanguages(["jp", "es", "en", "fr"]);
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     var tracks;
     var expectedTrack;
diff --git a/third_party/WebKit/LayoutTests/media/track/track-language-preference-no-crash.html b/third_party/WebKit/LayoutTests/media/track/track-language-preference-no-crash.html
index c361188..45beef5 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-language-preference-no-crash.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-language-preference-no-crash.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Tests that setting preferences on a track-less video element does not crash.</title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-language-preference.html b/third_party/WebKit/LayoutTests/media/track/track-language-preference.html
index 67c23dc..3edd1d6 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-language-preference.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-language-preference.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <title>Tests that the user's preferred languages are honored.</title>
 <video></video>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-large-timestamp.html b/third_party/WebKit/LayoutTests/media/track/track-large-timestamp.html
index 4481615d..81f8be9 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-large-timestamp.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-large-timestamp.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Tests that a very large timestamp is parsed correctly.</title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <video>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-mode-disabled-crash.html b/third_party/WebKit/LayoutTests/media/track/track-mode-disabled-crash.html
index ea707af6..4ed7a1e 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-mode-disabled-crash.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-mode-disabled-crash.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Tests that cues are properly removed from the active cue list when their track changes mode to disabled.</title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <video>
@@ -10,7 +11,7 @@
     var video = document.querySelector("video");
     var testTrack = document.querySelector("track");
 
-    video.src = "../content/counting.ogv";
+    video.src = findMediaFile("video", "../content/counting");
     video.oncanplaythrough = t.step_func(startTest);
     video.onseeked = t.step_func_done(seeked);
 
diff --git a/third_party/WebKit/LayoutTests/media/track/track-mode-not-changed-by-new-track.html b/third_party/WebKit/LayoutTests/media/track/track-mode-not-changed-by-new-track.html
index bac70940..5a455b1 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-mode-not-changed-by-new-track.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-mode-not-changed-by-new-track.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Tests that a track appended after the initial track configuration does not change other tracks.</title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <video>
@@ -13,7 +14,7 @@
     assert_equals(track1.readyState, HTMLTrackElement.NONE);
     assert_equals(track1.track.mode, 'disabled');
 
-    video.src = '../content/test.ogv';
+    video.src = findMediaFile('video', '../content/test');
     video.oncanplaythrough = t.step_func(canplaythrough);
     track1.onload = t.step_func(metadataTrackLoaded);
 
diff --git a/third_party/WebKit/LayoutTests/media/track/track-mode-triggers-loading.html b/third_party/WebKit/LayoutTests/media/track/track-mode-triggers-loading.html
index a17358d..dc10a5aa 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-mode-triggers-loading.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-mode-triggers-loading.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Tests that a "metadata" track does not load automatically, but does load when the mode is changed.</title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <video>
@@ -14,7 +15,7 @@
     assert_equals(track.readyState, HTMLTrackElement.NONE);
     assert_equals(video.textTracks[0].mode, "disabled");
 
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
     video.oncanplaythrough = t.step_func(canplaythrough);
     track.onload = t.step_func_done(trackLoaded);
 
diff --git a/third_party/WebKit/LayoutTests/media/track/track-mode.html b/third_party/WebKit/LayoutTests/media/track/track-mode.html
index 99a4ff5..bb4562f 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-mode.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-mode.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Tests that the TextTrack mode attribute is appropriately set.</title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <video>
@@ -32,7 +33,7 @@
         // Set to known values.
         setModeAndCheck("disabled");
 
-        video.src = "../content/test.ogv";
+        video.src = findMediaFile("video", "../content/test");
         video.play();
         // Wait for end of first cue (no events should fire while track is disabled).
         setTimeout(testHiddenAndShowing, 400);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-remove-active-cue-crash.html b/third_party/WebKit/LayoutTests/media/track/track-remove-active-cue-crash.html
index 8890631..06e2ab2 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-remove-active-cue-crash.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-remove-active-cue-crash.html
@@ -1,12 +1,13 @@
 <!DOCTYPE html>
 <title>Tests that removing an active cue does not crash the browser.</title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     // Add a text track to the video element.
     video.addTextTrack("captions", "regular captions track", "en");
diff --git a/third_party/WebKit/LayoutTests/media/track/track-remove-by-setting-innerHTML.html b/third_party/WebKit/LayoutTests/media/track/track-remove-by-setting-innerHTML.html
index 5673d8b..040baed 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-remove-by-setting-innerHTML.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-remove-by-setting-innerHTML.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>This test makes sure that removing a track by setting video.innerHTML doesn't crash (https://bugs.webkit.org/show_bug.cgi?id=100981). If this test does not crash, it passes.</title>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <video>
@@ -23,8 +24,8 @@
         video.currentTime = 7.9;
         firstSeek = false;
     });
-
+    
     video.currentTime = 0.5;
-    video.src = '../content/counting.ogv';
+    video.src = findMediaFile('video', '../content/counting');
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-remove-insert-ready-state.html b/third_party/WebKit/LayoutTests/media/track/track-remove-insert-ready-state.html
index fe0ae77..5d602681 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-remove-insert-ready-state.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-remove-insert-ready-state.html
@@ -3,12 +3,13 @@
 <video>
     <track src="captions-webvtt/tc004-no-webvtt.vtt" kind="captions" default>
 </video>
+<script src="../media-file.js"></script>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script>
 async_test(function(t) {
     var video = document.querySelector('video');
-    video.src = '../content/test.ogv';
+    video.src = findMediaFile('video', '../content/test');
     video.oncanplaythrough = t.step_func(canplaythrough);
 
     function canplaythrough() {
@@ -22,7 +23,7 @@
         document.body.removeChild(video);
 
         // Reset the video src attribute to re-trigger resource selection for tracks.
-        video.src = '../content/test.ogv';
+        video.src = findMediaFile('video', '../content/test');
 
         // Append the video element back to the body.
         document.body.appendChild(video);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-remove-quickly.html b/third_party/WebKit/LayoutTests/media/track/track-remove-quickly.html
index 3266eea..8649029 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-remove-quickly.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-remove-quickly.html
@@ -2,9 +2,10 @@
 <title>This test that removing a track element before it has been processed doesn't crash (https://bugs.webkit.org/show_bug.cgi?id=85095).</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <div id="video_container"></div>
 <script>
-var mediaFile = "../content/test.ogv";
+var mediaFile = findMediaFile("video", "../content/test");
 document.getElementById("video_container").innerHTML = "<video src='" + mediaFile + "' controls ><track kind='captions' src='captions-webvtt/simple-captions.vtt' default ></video>";
 test(function() {
 // Test passes if it doesn't crash.
diff --git a/third_party/WebKit/LayoutTests/media/track/track-remove-track.html b/third_party/WebKit/LayoutTests/media/track/track-remove-track.html
index 73d0349..a432428 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-remove-track.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-remove-track.html
@@ -3,7 +3,8 @@
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
-                <script src="../../resources/testharness.js"></script>
+        <script src="../media-file.js"></script>
+        <script src="../../resources/testharness.js"></script>
         <script src="../../resources/testharnessreport.js"></script>
     </head>
     <body>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines-expected.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines-expected.html
index 3dd6fca5..877333d7 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines-expected.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines-expected.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Reference test for track-webvtt-non-snap-to-lines.html.</title>
+<script src="../media-file.js"></script>
 <style>
 .container {
   position: relative;
@@ -18,7 +19,7 @@
 <div class="container">
   <video>
     <script>
-    document.currentScript.parentNode.src = '../content/test.ogv';
+    document.currentScript.parentNode.src = findMediaFile('video', '../content/test');
     </script>
   </video>
   <span class="cue">Bear is Coming!!!!!</div>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines.html
index 0bc4e12..3e45b33 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-non-snap-to-lines.html
@@ -5,6 +5,7 @@
   background: green;
 }
 </style>
+<script src="../media-file.js"></script>
 <video></video>
 <script>
 var video = document.querySelector("video");
@@ -15,5 +16,5 @@
 cue.align = "left";
 track.addCue(cue);
 track.mode = "showing";
-video.src = "../content/test.ogv";
+video.src = findMediaFile("video", "../content/test");
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-word-breaking.html b/third_party/WebKit/LayoutTests/media/track/track-word-breaking.html
index 24d151e..b1a606cb 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-word-breaking.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-word-breaking.html
@@ -2,6 +2,7 @@
 <title>Test that line breaks are forced in captions.</title>
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
 <script src="../media-controls.js"></script>
 <video>
     <track src="captions-webvtt/long-word.vtt" kind="captions" default>
@@ -21,7 +22,7 @@
         assert_greater_than(multiLineCaptionHeight / singleLineCaptionHeight, 2);
     });
 
-    video.src = "../content/test.ogv";
+    video.src = findMediaFile("video", "../content/test");
 
     function getCaptionLineHeight() {
         var captionElement = textTrackContainerElement(video).firstChild.firstChild;
diff --git a/third_party/WebKit/LayoutTests/media/unsupported-tracks.html b/third_party/WebKit/LayoutTests/media/unsupported-tracks.html
index 09e5077..f1fd3bc 100644
--- a/third_party/WebKit/LayoutTests/media/unsupported-tracks.html
+++ b/third_party/WebKit/LayoutTests/media/unsupported-tracks.html
@@ -2,11 +2,12 @@
 <title>Test that QuickTime file with unsupported track types only, generates an error.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/unsupported_track.ogv";
+    video.src = findMediaFile("video", "content/unsupported_track");
     video.onerror = t.step_func_done();
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-append-source.html b/third_party/WebKit/LayoutTests/media/video-append-source.html
index 3152888..4a97b68 100644
--- a/third_party/WebKit/LayoutTests/media/video-append-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-append-source.html
@@ -2,12 +2,13 @@
 <title>Verify that a media element's currentSrc is correctly set to source element's src</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
     assert_equals(video.currentSrc, "");
-    var mediaFile = "content/test.ogv";
+    var mediaFile = findMediaFile("video", "content/test");
     var source = document.createElement("source");
     source.src = mediaFile;
     video.appendChild(source);
diff --git a/third_party/WebKit/LayoutTests/media/video-aspect-ratio.html b/third_party/WebKit/LayoutTests/media/video-aspect-ratio.html
index 657b4fb..ffd95a9 100644
--- a/third_party/WebKit/LayoutTests/media/video-aspect-ratio.html
+++ b/third_party/WebKit/LayoutTests/media/video-aspect-ratio.html
@@ -1,6 +1,6 @@
 <script src="media-file.js"></script>
 <script src="video-paint-test.js"></script>
-<body onload="setSrcByTagName('video', 'content/test.ogv'); init()">
+<body onload="setSrcByTagName('video', findMediaFile('video', 'content/test')); init()">
 <p>Test video sizing. You should see one bigger image (paused video) and 7 small ones of 1/4 its size. </p>
 <video></video><br>
 <video style="width: 160px; height:120px">
diff --git a/third_party/WebKit/LayoutTests/media/video-autoplay.html b/third_party/WebKit/LayoutTests/media/video-autoplay.html
index 3f1bf06..5d3d8ff 100644
--- a/third_party/WebKit/LayoutTests/media/video-autoplay.html
+++ b/third_party/WebKit/LayoutTests/media/video-autoplay.html
@@ -2,6 +2,7 @@
 <title>Verify that "autoplay" attribute on a media element starts playback automatically.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video autoplay></video>
 <script>
 async_test(function(t) {
@@ -13,6 +14,6 @@
         assert_false(video.paused);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html b/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html
index a6db6f38..2ae28aa 100644
--- a/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html
+++ b/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html
@@ -2,6 +2,7 @@
 <title>Test that video media documents have a black background.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <iframe></iframe>
 <script>
 async_test(function(t) {
@@ -14,6 +15,6 @@
         assert_equals(iframeBodyStyle.backgroundColor, "rgb(0, 0, 0)");
     });
 
-    iframe.src = "content/counting.ogv";
+    iframe.src = findMediaFile("video", "content/counting");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html b/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html
index 3cbce76..8271244 100644
--- a/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html
+++ b/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html
@@ -2,6 +2,7 @@
 <title>Load a video with an infinite duration. Start playback and ensure video.currentTime is less than video.buffered.end(0) upon first timeupdate.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
diff --git a/third_party/WebKit/LayoutTests/media/video-buffered.html b/third_party/WebKit/LayoutTests/media/video-buffered.html
index 645dab5..b7b6070 100644
--- a/third_party/WebKit/LayoutTests/media/video-buffered.html
+++ b/third_party/WebKit/LayoutTests/media/video-buffered.html
@@ -2,6 +2,7 @@
 <title>Test video buffering properties.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -23,6 +24,6 @@
         assert_throws("IndexSizeError", function() { video.buffered.end(1); });
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-canvas-alpha.html b/third_party/WebKit/LayoutTests/media/video-canvas-alpha.html
index 82c438b..9ee14545 100644
--- a/third_party/WebKit/LayoutTests/media/video-canvas-alpha.html
+++ b/third_party/WebKit/LayoutTests/media/video-canvas-alpha.html
@@ -1,5 +1,6 @@
 <html>
  <head>
+  <script src="media-file.js"></script>
 
   <script>
     if (window.testRunner) {
@@ -8,8 +9,8 @@
 
     function onLoad() {
       video = document.getElementsByTagName('video')[0];
-      video.src = "content/test.ogv";
-
+      video.src = findMediaFile("video", "content/test");
+    
       canvas = document.getElementsByTagName('canvas')[0];
       ctx = canvas.getContext('2d');
 
@@ -21,7 +22,7 @@
         if (window.testRunner) {
           testRunner.notifyDone();
         }
-      });
+      }); 
     }
   </script>
  </head>
diff --git a/third_party/WebKit/LayoutTests/media/video-canvas-draw-expected.html b/third_party/WebKit/LayoutTests/media/video-canvas-draw-expected.html
index 4f0d5da6..0f9f145 100644
--- a/third_party/WebKit/LayoutTests/media/video-canvas-draw-expected.html
+++ b/third_party/WebKit/LayoutTests/media/video-canvas-draw-expected.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
+<script src="media-file.js"></script>
 <script>
 
 if (window.testRunner) {
@@ -20,16 +21,16 @@
     var video1 = document.getElementById('video1');
     var video2 = document.getElementById('video2');
     var video3 = document.getElementById('video3');
-    video1.src = "content/test.ogv";
+    video1.src = findMediaFile("video", "content/test");
     video2.src = video1.src;
     video3.src = video1.src;
 
     video1.load();
     video2.load();
     video3.load();
-    video1.addEventListener("canplay", onVideoLoaded);
-    video2.addEventListener("canplay", onVideoLoaded);
-    video3.addEventListener("canplay", onVideoLoaded);
+    video1.addEventListener("canplay", onVideoLoaded); 
+    video2.addEventListener("canplay", onVideoLoaded); 
+    video3.addEventListener("canplay", onVideoLoaded); 
 }
 
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-canvas-draw.html b/third_party/WebKit/LayoutTests/media/video-canvas-draw.html
index 8dc445b..1bf7227d 100644
--- a/third_party/WebKit/LayoutTests/media/video-canvas-draw.html
+++ b/third_party/WebKit/LayoutTests/media/video-canvas-draw.html
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
+<script src="media-file.js"></script>
 <script>
 
 if (window.testRunner) {
@@ -9,7 +10,7 @@
 
 function onLoad() {
     var video = document.getElementsByTagName('video')[0];
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 
     var canvas1 = document.getElementById('canvas1');
     var canvas2 = document.getElementById('canvas2');
@@ -26,7 +27,7 @@
         if (window.testRunner) {
             testRunner.notifyDone();
         }
-    });
+    }); 
 }
 
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-canvas-source.html b/third_party/WebKit/LayoutTests/media/video-canvas-source.html
index c8bc4c8f..0832004 100644
--- a/third_party/WebKit/LayoutTests/media/video-canvas-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-canvas-source.html
@@ -2,6 +2,7 @@
 <title>Verify that drawing to canvas using video with source element does not taint canvas</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <canvas></canvas>
 <script>
@@ -19,7 +20,7 @@
     });
 
     var source = document.createElement("source");
-    source.src = "content/counting.ogv";
+    source.src = findMediaFile("video", "content/counting");
     video.appendChild(source);
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-canvas.html b/third_party/WebKit/LayoutTests/media/video-canvas.html
index f3b1c88..3a0c2981 100644
--- a/third_party/WebKit/LayoutTests/media/video-canvas.html
+++ b/third_party/WebKit/LayoutTests/media/video-canvas.html
@@ -2,6 +2,7 @@
 <title>Test "video" as a source for "canvas".</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <canvas width="160" height="120"></canvas>
 <script>
@@ -57,6 +58,6 @@
             video.currentTime = results.values[results.current].time;
     }
 
-    video.src = "content/counting.ogv";
+    video.src = findMediaFile("video", "content/counting");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-colorspace-yuv420.html b/third_party/WebKit/LayoutTests/media/video-colorspace-yuv420.html
index 740f5dc..c19951a 100644
--- a/third_party/WebKit/LayoutTests/media/video-colorspace-yuv420.html
+++ b/third_party/WebKit/LayoutTests/media/video-colorspace-yuv420.html
@@ -7,7 +7,7 @@
     <p>Test correct colorspace for yuv420, i.e. YU12 video </p>
     <video/>
     <script>
-        setSrcByTagName('video', 'content/test_yuv420.ogv');
+        setSrcByTagName('video', findMediaFile('video', 'content/test_yuv420'));
         init();
     </script>
 </body>
diff --git a/third_party/WebKit/LayoutTests/media/video-colorspace-yuv422.html b/third_party/WebKit/LayoutTests/media/video-colorspace-yuv422.html
index 3e42c048..1b5bb23 100644
--- a/third_party/WebKit/LayoutTests/media/video-colorspace-yuv422.html
+++ b/third_party/WebKit/LayoutTests/media/video-colorspace-yuv422.html
@@ -7,7 +7,7 @@
     <p>Test correct colorspace for yuv422, i.e. YU16 video </p>
     <video/>
     <script>
-        setSrcByTagName('video', 'content/test_yuv422.ogv');
+        setSrcByTagName('video', findMediaFile('video', 'content/test_yuv422'));
         init();
     </script>
 </body>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-always-visible-when-control-hovered.html b/third_party/WebKit/LayoutTests/media/video-controls-always-visible-when-control-hovered.html
index 71ea685..5bc07fb 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-always-visible-when-control-hovered.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-always-visible-when-control-hovered.html
@@ -2,6 +2,7 @@
 <title>Verify that media controls are always visible when hovered.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls loop></video>
 <script>
@@ -25,6 +26,6 @@
         }), video);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-attribute-fullscreen.html b/third_party/WebKit/LayoutTests/media/video-controls-attribute-fullscreen.html
index fffbfca..0e9fe94 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-attribute-fullscreen.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-attribute-fullscreen.html
@@ -2,11 +2,12 @@
 <title>Test that the controls attribute is not affected by fullscreen</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.onloadeddata = t.step_func(function() {
         assert_false(video.controls);
         video.onwebkitfullscreenchange = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html b/third_party/WebKit/LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html
index 8f87fe0..3c2c2799 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html
@@ -2,6 +2,7 @@
 <title>Test video control element visibility when play by touch.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls loop></video>
 <script>
@@ -32,6 +33,6 @@
         }), video);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html b/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html
index 41b0b9bf..0b204f0 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="media-controls.js"></script>
+<script src="media-file.js"></script>
 <!-- "tabindex" makes the video focusable despite it not having controls -->
 <video tabindex="0"></video>
 <script>
@@ -17,7 +18,7 @@
         }), video);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.play();
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-download-button-not-displayed-local.html b/third_party/WebKit/LayoutTests/media/video-controls-download-button-not-displayed-local.html
index a356bec0..751ccfb 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-download-button-not-displayed-local.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-download-button-not-displayed-local.html
@@ -3,11 +3,12 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="media-controls.js"></script>
+<script src="media-file.js"></script>
 <video controls></video>
 <script>
 async_test(function(t) {
   var video = document.querySelector("video");
-  video.src = "content/test.ogv";
+  video.src = findMediaFile("video", "content/test");
   var controlID = "-internal-media-controls-download-button";
   var downloadButton = mediaControlsElement(internals.shadowRoot(video).firstChild, controlID);
   video.onloadeddata = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-focus-movement-on-hide.html b/third_party/WebKit/LayoutTests/media/video-controls-focus-movement-on-hide.html
index 5d858c18..ef9b581 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-focus-movement-on-hide.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-focus-movement-on-hide.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="media-controls.js"></script>
+<script src="media-file.js"></script>
 <video controls></video>
 <script>
 async_test(function(t) {
@@ -24,6 +25,6 @@
         }), video);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-allowed.html b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-allowed.html
index 65f641b9..f394b3c 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-allowed.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-allowed.html
@@ -4,7 +4,8 @@
         <title>video controls fullscreen button in iframe with allowfullscreen attribute</title>
         <script src="../resources/testharness.js"></script>
         <script src="../resources/testharnessreport.js"></script>
-                <script src="media-controls.js"></script>
+        <script src="media-file.js"></script>
+        <script src="media-controls.js"></script>
         <script src="video-controls-fullscreen.js"></script>
     </head>
     <body>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-not-allowed.html b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-not-allowed.html
index 049d9f9..b270d8f6 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-not-allowed.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-iframe-not-allowed.html
@@ -4,7 +4,8 @@
         <title>video controls fullscreen button in iframe without allowfullscreen attribute</title>
         <script src="../resources/testharness.js"></script>
         <script src="../resources/testharnessreport.js"></script>
-                <script src="media-controls.js"></script>
+        <script src="media-file.js"></script>
+        <script src="media-controls.js"></script>
         <script src="video-controls-fullscreen.js"></script>
     </head>
     <body>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-not-supported.html b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-not-supported.html
index 4931e3b..028f7ae 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-not-supported.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen-not-supported.html
@@ -4,7 +4,8 @@
         <title>video controls fullscreen button with fullscreenSupported setting disabled</title>
         <script src="../resources/testharness.js"></script>
         <script src="../resources/testharnessreport.js"></script>
-                <script src="media-controls.js"></script>
+        <script src="media-file.js"></script>
+        <script src="media-controls.js"></script>
         <script src="video-controls-fullscreen.js"></script>
     </head>
     <body>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.html b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.html
index 514894a..38fddf1 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.html
@@ -4,7 +4,8 @@
         <title>video controls fullscreen button</title>
         <script src="../resources/testharness.js"></script>
         <script src="../resources/testharnessreport.js"></script>
-                <script src="media-controls.js"></script>
+        <script src="media-file.js"></script>
+        <script src="media-controls.js"></script>
         <script src="video-controls-fullscreen.js"></script>
     </head>
     <body>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.js b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.js
index 6cbceae..5c953fe 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.js
+++ b/third_party/WebKit/LayoutTests/media/video-controls-fullscreen.js
@@ -7,8 +7,8 @@
         var v1 = document.createElement("video");
         var v2 = document.createElement("video");
         v1.controls = v2.controls = true;
-        v1.src = "content/test.ogv";
-        v2.src = "content/test.oga";
+        v1.src = findMediaFile("video", "content/test");
+        v2.src = findMediaFile("audio", "content/test");
         document.body.appendChild(v1);
         document.body.appendChild(v2);
 
@@ -41,7 +41,7 @@
         var doc = iframe.contentDocument;
         var v = doc.createElement("video");
         v.controls = true;
-        v.src = "content/test.ogv";
+        v.src = findMediaFile("video", "content/test");
         doc.body.appendChild(v);
 
         v.addEventListener("loadeddata", t.step_func_done(function()
@@ -58,7 +58,7 @@
     {
         var v = document.createElement("video");
         v.controls = true;
-        v.src = "content/test.ogv";
+        v.src = findMediaFile("video", "content/test");
         document.body.appendChild(v);
 
         v.addEventListener("loadeddata", t.step_func_done(function()
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-hidden-audio.html b/third_party/WebKit/LayoutTests/media/video-controls-hidden-audio.html
index e4cc123..5d023ca2 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-hidden-audio.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-hidden-audio.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="media-controls.js"></script>
+<script src="media-file.js"></script>
 <video controls></video>
 <script>
 async_test(function(t) {
@@ -46,6 +47,6 @@
     video.muted = true;
   });
 
-  video.src = "content/test.ogv";
+  video.src = findMediaFile("video", "content/test");
 })
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-hide-after-touch-on-control.html b/third_party/WebKit/LayoutTests/media/video-controls-hide-after-touch-on-control.html
index bb4767d..37c5aeaa 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-hide-after-touch-on-control.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-hide-after-touch-on-control.html
@@ -2,6 +2,7 @@
 <title>Test video controls visibility on touch. After a delay the controls must be hidden.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls loop></video>
 <script>
@@ -24,6 +25,6 @@
         }), video);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-hide-on-move-outside-controls.html b/third_party/WebKit/LayoutTests/media/video-controls-hide-on-move-outside-controls.html
index 386dfa42..aa6c602 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-hide-on-move-outside-controls.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-hide-on-move-outside-controls.html
@@ -2,6 +2,7 @@
 <title>Test video controls visibility when mouse is not over controls.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls loop></video>
 <script>
@@ -27,6 +28,6 @@
         eventSender.mouseMoveTo(video.offsetLeft + 4, video.offsetTop + 4);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html b/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html
index 1386a2e5..05b878d 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html
@@ -2,6 +2,7 @@
 <title>Test that controls don't increase the size of the container (i.e. are rendered overlapping with the video canvas).</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <iframe style="width: 400px; height: 300px; border: 0px;"></iframe>
 <script>
 async_test(function(t) {
@@ -16,6 +17,6 @@
         });
     });
 
-    iframe.src = "content/test.ogv";
+    iframe.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-labels.html b/third_party/WebKit/LayoutTests/media/video-controls-labels.html
index 7ef52c8..697eae15 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-labels.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-labels.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="media-controls.js"></script>
+<script src="media-file.js"></script>
 <video controls>
   <track kind="subtitles" src="captions.vtt" srclang="is" label="Icelandic">
   <track kind="subtitles" src="captions-fast.vtt" srclang="fr" label="">
@@ -25,6 +26,6 @@
         assert_equals(captionsList.children[3].innerText, "Track 3");
     });
 
-    video.src = "content/counting.ogv";
+    video.src = findMediaFile("video", "content/counting");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-mouse-events-captured.html b/third_party/WebKit/LayoutTests/media/video-controls-mouse-events-captured.html
index bd8a817..052b988 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-mouse-events-captured.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-mouse-events-captured.html
@@ -2,6 +2,7 @@
 <title>This tests that a mouse/keyboard event on the controls will not be seen by the video element.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls></video>
 <script>
@@ -61,6 +62,6 @@
         eventSender.keyDown('A');
     }
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html b/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html
index db29c9ac..c12fe6e3 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html
@@ -2,6 +2,7 @@
 <title>Test that muted video has an unmute button.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls></video>
 <script>
@@ -16,6 +17,6 @@
         assert_not_equals(getComputedStyle(muteButton).display, "none");
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-button.html b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-button.html
index f1c3212..fff2b17 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-button.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-button.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="media-controls.js"></script>
+<script src="media-file.js"></script>
 <script src="overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -12,7 +13,7 @@
 async_test(function(t) {
   // Set up video.
   var video = document.querySelector("video");
-  video.src = "content/test.ogv";
+  video.src = findMediaFile("video", "content/test");
   video.setAttribute("width", "60");
   // Add two captions.
   video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-list-hide-on-click-outside.html b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-list-hide-on-click-outside.html
index 06f75c2..34f0b45 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-list-hide-on-click-outside.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-list-hide-on-click-outside.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="media-controls.js"></script>
+<script src="media-file.js"></script>
 <script src="overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -12,7 +13,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "content/test.ogv";
+  video.src = findMediaFile("video", "content/test");
   video.setAttribute("width", "60");
   // Add captions
   var track = video.addTextTrack("captions");
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-fullscreen-button.html b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-fullscreen-button.html
index 9969bcf..30fccc1 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-fullscreen-button.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-fullscreen-button.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="media-controls.js"></script>
+<script src="media-file.js"></script>
 <script src="overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -12,7 +13,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "content/test.ogv";
+  video.src = findMediaFile("video", "content/test");
   video.setAttribute("width", "60");
 
   window.addEventListener("load", t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-last-button-visible.html b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-last-button-visible.html
index 114a784..4446dc1 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-last-button-visible.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-last-button-visible.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="media-controls.js"></script>
+<script src="media-file.js"></script>
 <script src="overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -13,10 +14,10 @@
 async_test(function(t) {
    // Set up video
   var video = document.querySelector("video");
-  video.src = "content/test.ogv";
+  video.src = findMediaFile("video", "content/test");
 
   var audio = document.querySelector("audio");
-  audio.src = "content/test.oga";
+  audio.src = findMediaFile("audio", "content/test");
 
   video.onloadeddata = t.step_func_done(function() {
     var overflowVideo = getOverflowMenuButton(video);
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-mute-button.html b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-mute-button.html
index e0e2e41..9ce5a68 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-mute-button.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-mute-button.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="media-controls.js"></script>
+<script src="media-file.js"></script>
 <script src="overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -12,7 +13,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "content/test.ogv";
+  video.src = findMediaFile("video", "content/test");
   video.setAttribute("width", "60");
 
   video.onloadeddata = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-play-button.html b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-play-button.html
index 874d194..07a0562 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-play-button.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-play-button.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="media-controls.js"></script>
+<script src="media-file.js"></script>
 <script src="overflow-menu.js"></script>
 
 <!--Padding ensures the overflow menu is visible for the tests. -->
@@ -12,7 +13,7 @@
 async_test(function(t) {
   // Set up video
   var video = document.querySelector("video");
-  video.src = "content/test.ogv";
+  video.src = findMediaFile("video", "content/test");
   video.setAttribute("width", "60");
 
   video.onloadeddata = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-rendering.html b/third_party/WebKit/LayoutTests/media/video-controls-rendering.html
index 9f0273a..d9b7aee 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-rendering.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-rendering.html
@@ -15,6 +15,6 @@
 if (window.internals)
     window.internals.settings.setMockScrollbarsEnabled(true);
 init();
-setSrcByTagName('video', 'content/test.ogv');
+setSrcByTagName('video', findMediaFile('video', 'content/test'));
 </script>
 </body>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html b/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html
index 39efcff..2e7f025 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html
@@ -2,6 +2,7 @@
 <title>Test visibiblity of controls when focusing video.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls autoplay></video>
 <script>
@@ -21,6 +22,6 @@
         }), video);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-toggling.html b/third_party/WebKit/LayoutTests/media/video-controls-toggling.html
index c80f576..98beb5e 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-toggling.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-toggling.html
@@ -2,6 +2,7 @@
 <title>Test rendering of volume slider of video tag.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls></video>
 <script>
@@ -13,7 +14,7 @@
     video.onplay = t.step_func(function() {
         panel = mediaControlsButton(video, "panel");
         muteButtonCoordinates = mediaControlsButtonCoordinates(video, "mute-button");
-
+        
         // Move mouse somewhere over the panel.
         eventSender.mouseMoveTo(muteButtonCoordinates[0], muteButtonCoordinates[1]);
 
@@ -42,7 +43,7 @@
         t.done();
     }
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.play();
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-touch-events-captured.html b/third_party/WebKit/LayoutTests/media/video-controls-touch-events-captured.html
index 2f7f0f7..cd1b40b 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-touch-events-captured.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-touch-events-captured.html
@@ -2,6 +2,7 @@
 <title>Test that touch events on the controls will not be seen by the video element.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls></video>
 <script>
@@ -42,6 +43,6 @@
             eventSender.cancelTouchPoint(0);
     }
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-track-selection-menu.html b/third_party/WebKit/LayoutTests/media/video-controls-track-selection-menu.html
index 3139ff1..989249c 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-track-selection-menu.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-track-selection-menu.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="track/track-helpers.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <!-- Width should be large enough to display closed captions button. -->
 <video controls style="width: 500px">
@@ -44,7 +45,7 @@
             assert_equals(textTrackDisplayElement(video).innerText, "first caption");
         });
 
-        video.src = "content/test.ogv";
+        video.src = findMediaFile("video", "content/test");
     }
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-transformed.html b/third_party/WebKit/LayoutTests/media/video-controls-transformed.html
index b70ac0a..b579419 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-transformed.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-transformed.html
@@ -2,6 +2,7 @@
 <title>Test "controls" on transformed video.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <style>
 video {
@@ -24,6 +25,6 @@
         assert_false(video.paused);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html b/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html
index e2abfcd..a762090 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html
@@ -2,6 +2,7 @@
 <title>Test video controls visibility with multimodal input. The controls should remain visible if the last input event was a mouse move over them.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls loop></video>
 <script>
@@ -23,7 +24,7 @@
             // And then hover the control with the mouse.
             eventSender.mouseMoveTo(0, 0);
             eventSender.mouseMoveTo(coords[0], coords[1]);
-
+            
             // And the controls should remain visible.
             runAfterHideMediaControlsTimerFired(t.step_func_done(function() {
                 assert_true(isControlsPanelVisible(video));
@@ -31,6 +32,6 @@
         }), video);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-touch-after-mouse.html b/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-touch-after-mouse.html
index 7ccc2e47..c578b4e 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-touch-after-mouse.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-touch-after-mouse.html
@@ -2,6 +2,7 @@
 <title>Test video controls visibility with multimodal input. The controls should hide after a timeout if the last input event was a tap.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <video controls loop></video>
 <script>
@@ -35,6 +36,6 @@
 
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-visible-audio-only.html b/third_party/WebKit/LayoutTests/media/video-controls-visible-audio-only.html
index 2bb7834ff..a267a38 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-visible-audio-only.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-visible-audio-only.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <style>
-            #no-video-media { background-color: yellow; width: 320px; height: 100px;}
+            #no-video-media { background-color: yellow; width: 320px; height: 100px;} 
             #mouse-parking:hover { padding:8; background-color: blue; }
         </style>
         <script src=media-file.js></script>
@@ -20,15 +20,15 @@
                 var console = document.getElementById("console");
                 console.innerHTML += text + "<br>";
             }
-
+            
             function testcondition(testFuncString, endit)
             {
                 if (eval(testFuncString))
                     consoleWrite("TEST(" + testFuncString + ") <span style='color:green'>OK</span>");
                 else
-                    consoleWrite("TEST(" + testFuncString + ") <span style='color:red'>FAIL</span>");
+                    consoleWrite("TEST(" + testFuncString + ") <span style='color:red'>FAIL</span>");    
             }
-
+            
             function start()
             {
                 video = document.getElementById("no-video-media");
@@ -62,8 +62,8 @@
             }
 
             if (window.testRunner) {
-                setTimeout(function() {
-                    document.body.appendChild(document.createTextNode('FAIL'));
+                setTimeout(function() { 
+                    document.body.appendChild(document.createTextNode('FAIL')); 
                     if (window.testRunner)
                         testRunner.notifyDone();
                 } , 8000);
@@ -81,7 +81,7 @@
         <video id="no-video-media" controls loop oncanplaythrough="start()"></video>
         <br><br><div id="console"></div>
         <script>
-            setSrcById("no-video-media", "content/test.oga");
+            setSrcById("no-video-media", findMediaFile("audio", "content/test"));
         </script>
     </body>
 </html>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-zoomed.html b/third_party/WebKit/LayoutTests/media/video-controls-zoomed.html
index d76b9ce..b831b91 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-zoomed.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-zoomed.html
@@ -2,6 +2,7 @@
 <title>Test controls with zooming.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
 <style>
 video {
@@ -34,6 +35,6 @@
         }, 50);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-controls.html b/third_party/WebKit/LayoutTests/media/video-controls.html
index 75dd19e..c2c26a7 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls.html
@@ -2,6 +2,7 @@
 <title>Test "controls" attribute.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video controls></video>
 <script>
 async_test(function(t) {
@@ -20,6 +21,6 @@
         assert_true(video.controls);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html
index 5574eaa..453517d 100644
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html
@@ -2,11 +2,12 @@
 <title>Test currentTime values when setting while readystate is HAVE_NOTHING for media fragment URI.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/test.ogv" + "#t=2";
+    video.src = findMediaFile("video", "content/test") + "#t=2";
     assert_equals(video.currentTime, 0);
     video.currentTime = 1;
 
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html
index 5c9978b..4bea570 100644
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html
@@ -2,11 +2,12 @@
 <title>Test currentTime values when setting while readystate is HAVE_NOTHING.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     assert_equals(video.currentTime, 0);
     video.currentTime = 1;
     assert_equals(video.currentTime, 1);
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html b/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html
index 4ae1630..be0fff4 100644
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html
@@ -2,6 +2,7 @@
 <title>Test, a delay in playing the movie still results in an "ended" event.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -20,6 +21,6 @@
     });
 
     video.onended = t.step_func_done();
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-set.html b/third_party/WebKit/LayoutTests/media/video-currentTime-set.html
index 9ec6ad3..614144b 100644
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-set.html
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-set.html
@@ -2,6 +2,7 @@
 <title>Test that setting currentTime changes the time, and that "ended" event is fired in a reasonable amount of time.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -19,6 +20,6 @@
         video.play();
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html b/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html
index 53b46cc4..350c058 100644
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html
@@ -2,6 +2,7 @@
 <title>Test that setting currentTime changes the time, and setting invalid values throw exceptions.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -18,6 +19,6 @@
         assert_equals(video.currentTime, 3.1);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime.html b/third_party/WebKit/LayoutTests/media/video-currentTime.html
index dbd5abc0..b8b190c 100644
--- a/third_party/WebKit/LayoutTests/media/video-currentTime.html
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime.html
@@ -2,6 +2,7 @@
 <title>Test media current time values.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -17,6 +18,6 @@
         }), 500);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-defaultmuted.html b/third_party/WebKit/LayoutTests/media/video-defaultmuted.html
index d8b47c0..db62a01 100644
--- a/third_party/WebKit/LayoutTests/media/video-defaultmuted.html
+++ b/third_party/WebKit/LayoutTests/media/video-defaultmuted.html
@@ -2,6 +2,7 @@
 <title>Test "defaultMuted" IDL, "muted" IDL and content attributes.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
 test(function() {
     var video = document.createElement("video");
@@ -31,6 +32,6 @@
         assert_false(video.muted);
     });
 
-    video.src = "content/test.oga";
+    video.src = findMediaFile("audio", "content/test");
 }, "Test 'muted' content and IDL attributes on video load");
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-delay-load-event.html b/third_party/WebKit/LayoutTests/media/video-delay-load-event.html
index 5064289..3592227 100644
--- a/third_party/WebKit/LayoutTests/media/video-delay-load-event.html
+++ b/third_party/WebKit/LayoutTests/media/video-delay-load-event.html
@@ -2,6 +2,7 @@
 <title>Test that the document's load event is delayed until a video's meta data is available.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video id="video1"></video>
 <video id="video2"></video>
 <video id="video3"><source></source></video>
@@ -10,11 +11,11 @@
     assertVideoNoSrcNoLoad(document.getElementById("video1"));
 
     var video = document.getElementById("video2");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     assertVideoSrcNoLoad(video);
 
     var source = document.querySelector("source");
-    source.src = "content/test.ogv";
+    source.src = findMediaFile("video", "content/test");
     assertVideoSrcNoLoad(document.getElementById("video3"));
 
     window.onload = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-display-aspect-ratio.html b/third_party/WebKit/LayoutTests/media/video-display-aspect-ratio.html
index 422681e1..96d91ef 100644
--- a/third_party/WebKit/LayoutTests/media/video-display-aspect-ratio.html
+++ b/third_party/WebKit/LayoutTests/media/video-display-aspect-ratio.html
@@ -2,6 +2,7 @@
 <title>Test video dimension aspect ratio.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -14,6 +15,6 @@
         assert_equals(video.videoHeight, 240);
     });
 
-    video.src = "content/test-par-16-9.ogv";
+    video.src = findMediaFile("video", "content/test-par-16-9");
 });
-</script>
\ No newline at end of file
+</script>
diff --git a/third_party/WebKit/LayoutTests/media/video-display-none-crash.html b/third_party/WebKit/LayoutTests/media/video-display-none-crash.html
index eee208f..67812acc 100644
--- a/third_party/WebKit/LayoutTests/media/video-display-none-crash.html
+++ b/third_party/WebKit/LayoutTests/media/video-display-none-crash.html
@@ -2,11 +2,12 @@
 <title>Test that pause() after changing display to "none" doesn't cause a crash.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 test(function() {
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.play();
     video.style.display = "none";
     video.pause();
diff --git a/third_party/WebKit/LayoutTests/media/video-display-toggle.html b/third_party/WebKit/LayoutTests/media/video-display-toggle.html
index 56c577a..83aae36 100644
--- a/third_party/WebKit/LayoutTests/media/video-display-toggle.html
+++ b/third_party/WebKit/LayoutTests/media/video-display-toggle.html
@@ -16,7 +16,7 @@
             {
                 if (window.testRunner)
                     testRunner.waitUntilDone();
-                setSrcById('vid', 'content/test.ogv');
+                setSrcById('vid', findMediaFile('video', 'content/test'));
                 var video = document.getElementById('vid');
                 video.addEventListener("canplaythrough", test2);
                 video.load();
diff --git a/third_party/WebKit/LayoutTests/media/video-dom-autoplay.html b/third_party/WebKit/LayoutTests/media/video-dom-autoplay.html
index 991eaaa..8aaf56e2 100644
--- a/third_party/WebKit/LayoutTests/media/video-dom-autoplay.html
+++ b/third_party/WebKit/LayoutTests/media/video-dom-autoplay.html
@@ -2,6 +2,7 @@
 <title>Test media "autoplay" attribute set via DOM.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -15,6 +16,6 @@
         assert_false(video.paused);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-dom-src.html b/third_party/WebKit/LayoutTests/media/video-dom-src.html
index 47c6877..e214ce6 100644
--- a/third_party/WebKit/LayoutTests/media/video-dom-src.html
+++ b/third_party/WebKit/LayoutTests/media/video-dom-src.html
@@ -2,12 +2,13 @@
 <title>Test media "src" attribute set via DOM.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
     assert_equals(video.currentSrc, "");
-    var mediaFile = "content/test.ogv";
+    var mediaFile = findMediaFile("video", "content/test");
     video.src = mediaFile;
     assert_equals(video.currentSrc, "");
 
diff --git a/third_party/WebKit/LayoutTests/media/video-double-seek-currentTime.html b/third_party/WebKit/LayoutTests/media/video-double-seek-currentTime.html
index 612d148..fe5e533 100644
--- a/third_party/WebKit/LayoutTests/media/video-double-seek-currentTime.html
+++ b/third_party/WebKit/LayoutTests/media/video-double-seek-currentTime.html
@@ -2,6 +2,7 @@
 <title>Test double seek currentTime.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 // Seek to same time twice and make sure "seeking" is fired twice and that
@@ -26,6 +27,6 @@
         assert_equals(video.currentTime, timeToTest);
     }));
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html b/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html
index 296a1b2..a1c3fac 100644
--- a/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html
+++ b/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html
@@ -2,6 +2,7 @@
 <title>Tests that duration is known after playback ended.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -16,7 +17,7 @@
         video.currentTime = video.duration - 0.2;
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.play();
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-enter-fullscreen-without-user-gesture.html b/third_party/WebKit/LayoutTests/media/video-enter-fullscreen-without-user-gesture.html
index 4e255a4a..b6cd9a4f 100644
--- a/third_party/WebKit/LayoutTests/media/video-enter-fullscreen-without-user-gesture.html
+++ b/third_party/WebKit/LayoutTests/media/video-enter-fullscreen-without-user-gesture.html
@@ -2,6 +2,7 @@
 <title>Test webkitRequestFullscreen() without any user gesture.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -14,6 +15,6 @@
         video.onwebkitfullscreenerror = t.step_func_done();
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-error-networkState.html b/third_party/WebKit/LayoutTests/media/video-error-networkState.html
index be5a43d..535e2eff 100644
--- a/third_party/WebKit/LayoutTests/media/video-error-networkState.html
+++ b/third_party/WebKit/LayoutTests/media/video-error-networkState.html
@@ -2,6 +2,7 @@
 <title>Test media element networkState value in an error corner case.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -27,7 +28,7 @@
       }), 0);
     });
 
-    video.src = "content/corrupt.ogv";
+    video.src = findMediaFile("video", "content/corrupt");
     video.play();
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-load.html b/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-load.html
index 2b5392b..c7b1a376 100644
--- a/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-load.html
+++ b/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-load.html
@@ -2,11 +2,12 @@
 <title>Test that loading a video element with preload "none" changes its effective preload to "metadata"</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video preload="none"></video>
 <script>
 test(function() {
     var video = document.querySelector('video');
-    video.src = 'content/test.ogv';
+    video.src = findMediaFile('video', 'content/test');
     assert_equals(internals.effectivePreload(video), "none");
     video.load();
     assert_equals(internals.effectivePreload(video), "metadata");
diff --git a/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-play.html b/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-play.html
index e35facd..1b494fe 100644
--- a/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-play.html
+++ b/third_party/WebKit/LayoutTests/media/video-force-preload-none-to-metadata-on-play.html
@@ -2,11 +2,12 @@
 <title>Test that playing a video element with preload "none" changes its effective preload to "metadata"</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video preload="none"></video>
 <script>
 test(function() {
     var video = document.querySelector('video');
-    video.src = 'content/test.ogv';
+    video.src = findMediaFile('video', 'content/test');
     assert_equals(internals.effectivePreload(video), "none");
     video.play();
     assert_equals(internals.effectivePreload(video), "metadata");
diff --git a/third_party/WebKit/LayoutTests/media/video-frame-accurate-seek.html b/third_party/WebKit/LayoutTests/media/video-frame-accurate-seek.html
index 25ecf93..a92a866 100644
--- a/third_party/WebKit/LayoutTests/media/video-frame-accurate-seek.html
+++ b/third_party/WebKit/LayoutTests/media/video-frame-accurate-seek.html
@@ -4,7 +4,7 @@
         <script src="media-file.js"></script>
         <script src="video-paint-test.js"></script>
     </head>
-    <body onload="setSrcByTagName('video', 'content/test-25fps.ogv'); initAndSeeked()">
+    <body onload="setSrcByTagName('video', findMediaFile('video', 'content/test-25fps')); initAndSeeked()">
         <p>Test that setting currentTime is frame-accurate. The three videos below should be showing frames 12, 13, and 14.</p>
         <video oncanplaythrough='event.target.currentTime=(12/25)'></video>
         <video oncanplaythrough='event.target.currentTime=(13/25)'></video>
diff --git a/third_party/WebKit/LayoutTests/media/video-layer-crash.html b/third_party/WebKit/LayoutTests/media/video-layer-crash.html
index 96373a9..1c2cc22 100644
--- a/third_party/WebKit/LayoutTests/media/video-layer-crash.html
+++ b/third_party/WebKit/LayoutTests/media/video-layer-crash.html
@@ -12,7 +12,7 @@
         &nbsp;<video style="transform:scale(0.5)"></video><br>
         &nbsp;<video style="transform:skew(20deg)"></video><br>
         <script>
-            setSrcByTagName('video', 'content/test.ogv');
+            setSrcByTagName('video', findMediaFile('video', 'content/test'));
             document.body.removeChild(document.getElementById('one')); document.body.offsetLeft;
             init();
         </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-load-networkState.html b/third_party/WebKit/LayoutTests/media/video-load-networkState.html
index b26125dc..e4175ed 100644
--- a/third_party/WebKit/LayoutTests/media/video-load-networkState.html
+++ b/third_party/WebKit/LayoutTests/media/video-load-networkState.html
@@ -2,6 +2,7 @@
 <title>Test that setting src to an invalid url triggers load(), which sets networkState to NETWORK_NO_SOURCE. Setting src to a valid url should then trigger the loading events and end up with networkState >= NETWORK_LOADING.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -16,7 +17,7 @@
     video.onerror = t.step_func(function() {
         assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE);
         // now set a valid url
-        video.src = "content/test.ogv";
+        video.src = findMediaFile("video", "content/test");
     });
 
     video.oncanplaythrough = t.step_func_done(function () {
diff --git a/third_party/WebKit/LayoutTests/media/video-load-preload-none.html b/third_party/WebKit/LayoutTests/media/video-load-preload-none.html
index e7ed897..bc789b3 100644
--- a/third_party/WebKit/LayoutTests/media/video-load-preload-none.html
+++ b/third_party/WebKit/LayoutTests/media/video-load-preload-none.html
@@ -2,6 +2,7 @@
 <title>Test that an explicit load() to a media element whose preload is set to "none" still loads the video.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video preload="none"></video>
 <script>
 async_test(function(t) {
@@ -19,6 +20,6 @@
         video.load();
     }, 300);
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-load-readyState.html b/third_party/WebKit/LayoutTests/media/video-load-readyState.html
index 4e6cc93e..56b6b11 100644
--- a/third_party/WebKit/LayoutTests/media/video-load-readyState.html
+++ b/third_party/WebKit/LayoutTests/media/video-load-readyState.html
@@ -2,6 +2,7 @@
 <title>Test media element readystate value on load.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -18,6 +19,6 @@
         assert_equals(video.readyState, HTMLMediaElement.HAVE_ENOUGH_DATA);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-loop-from-ended.html b/third_party/WebKit/LayoutTests/media/video-loop-from-ended.html
index b225846d..a441d48 100644
--- a/third_party/WebKit/LayoutTests/media/video-loop-from-ended.html
+++ b/third_party/WebKit/LayoutTests/media/video-loop-from-ended.html
@@ -2,6 +2,7 @@
 <title>Test looping edge case to verify http://crbug.com/364442.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 // Seek towards end of video (for faster testing).
@@ -49,6 +50,6 @@
         video.play();
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-loop.html b/third_party/WebKit/LayoutTests/media/video-loop.html
index 09ba701..4aee3df 100644
--- a/third_party/WebKit/LayoutTests/media/video-loop.html
+++ b/third_party/WebKit/LayoutTests/media/video-loop.html
@@ -2,6 +2,7 @@
 <title>Test video looping.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video autoplay></video>
 <script>
 // Test looping by:
@@ -67,6 +68,6 @@
 
     // Set "loop" to true and begin playing.
     video.loop = true;
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-move-to-new-document-crash.html b/third_party/WebKit/LayoutTests/media/video-move-to-new-document-crash.html
index 6476448..cba59dc1 100644
--- a/third_party/WebKit/LayoutTests/media/video-move-to-new-document-crash.html
+++ b/third_party/WebKit/LayoutTests/media/video-move-to-new-document-crash.html
@@ -2,10 +2,11 @@
 <title>Test that moving video element to a new document and performing an operation on it doesn't crash.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
 async_test(function(t) {
     var v = document.createElement('video');
-    v.src = 'content/test.ogv';
+    v.src = findMediaFile('video', 'content/test');
     v.oncanplaythrough = t.step_func(function() {
         var newDoc = document.implementation.createDocument( "", null);
         newDoc.adoptNode(v);
diff --git a/third_party/WebKit/LayoutTests/media/video-move-to-new-document-srcobject.html b/third_party/WebKit/LayoutTests/media/video-move-to-new-document-srcobject.html
index 361e0458..9bb762f 100644
--- a/third_party/WebKit/LayoutTests/media/video-move-to-new-document-srcobject.html
+++ b/third_party/WebKit/LayoutTests/media/video-move-to-new-document-srcobject.html
@@ -2,6 +2,7 @@
 <title>Verify that moving a video element to a new document, still loads it normally</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <iframe></iframe>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-move-to-new-document.html b/third_party/WebKit/LayoutTests/media/video-move-to-new-document.html
index 18bbd24..139f701 100644
--- a/third_party/WebKit/LayoutTests/media/video-move-to-new-document.html
+++ b/third_party/WebKit/LayoutTests/media/video-move-to-new-document.html
@@ -2,12 +2,13 @@
 <title>Verify that moving a video element to a new document, still loads it normally</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <iframe></iframe>
 <script>
     async_test(function(t) {
         var video = document.querySelector('video');
-        video.src = "content/test.ogv";
+        video.src = findMediaFile("video", "content/test");
         video.onloadeddata = this.step_func(function() {
             video.onloadeddata = null;
             assert_true(video.networkState == video.NETWORK_IDLE || video.networkState == video.NETWORK_LOADING);
diff --git a/third_party/WebKit/LayoutTests/media/video-muted.html b/third_party/WebKit/LayoutTests/media/video-muted.html
index 965a8ae2..07d4247 100644
--- a/third_party/WebKit/LayoutTests/media/video-muted.html
+++ b/third_party/WebKit/LayoutTests/media/video-muted.html
@@ -2,6 +2,7 @@
 <title>Test "muted" attribute.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -16,6 +17,6 @@
         assert_false(video.muted);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-no-audio.html b/third_party/WebKit/LayoutTests/media/video-no-audio.html
index 209746e..22586257 100644
--- a/third_party/WebKit/LayoutTests/media/video-no-audio.html
+++ b/third_party/WebKit/LayoutTests/media/video-no-audio.html
@@ -4,10 +4,10 @@
         <script>
             if (window.testRunner)
                 testRunner.waitUntilDone();
-
+    
             function start()
             {
-                setSrcByTagName("video", "content/counting.ogv");
+                setSrcByTagName("video", findMediaFile("video", "content/counting"));
             }
 
             function finish()
diff --git a/third_party/WebKit/LayoutTests/media/video-no-autoplay.html b/third_party/WebKit/LayoutTests/media/video-no-autoplay.html
index 867fdd2..d10b5cc 100644
--- a/third_party/WebKit/LayoutTests/media/video-no-autoplay.html
+++ b/third_party/WebKit/LayoutTests/media/video-no-autoplay.html
@@ -2,6 +2,7 @@
 <title>Test that play event does not fire when "src" set with no autoplay attribute.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -16,6 +17,6 @@
         }), 500);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-no-controls-events-not-absorbed.html b/third_party/WebKit/LayoutTests/media/video-no-controls-events-not-absorbed.html
index 2219bb3..13bdfc8 100644
--- a/third_party/WebKit/LayoutTests/media/video-no-controls-events-not-absorbed.html
+++ b/third_party/WebKit/LayoutTests/media/video-no-controls-events-not-absorbed.html
@@ -2,6 +2,7 @@
 <title>Video elements without controls should not absborb click events</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 test(_ => {
@@ -21,6 +22,6 @@
     t.done();
   }));
 
-  video.src = 'content/test.ogv';
+  video.src = findMediaFile('video', 'content/test');
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html b/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html
index 4974a9d8..3f0b2c5 100644
--- a/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html
+++ b/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html
@@ -2,6 +2,7 @@
 <title>Test that no timeupdate event fires during loading.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -17,6 +18,6 @@
     });
 
     video.ontimeupdate = t.unreached_func();
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-object-fit-change-expected.html b/third_party/WebKit/LayoutTests/media/video-object-fit-change-expected.html
index c016b30..0fedd32 100644
--- a/third_party/WebKit/LayoutTests/media/video-object-fit-change-expected.html
+++ b/third_party/WebKit/LayoutTests/media/video-object-fit-change-expected.html
@@ -18,7 +18,7 @@
 
         function init()
         {
-            setSrcByTagName("video", "content/test.ogv");
+            setSrcByTagName("video", findMediaFile("video", "content/test"));
 
             var totalCount = document.getElementsByTagName('video').length;
             var count = totalCount;
diff --git a/third_party/WebKit/LayoutTests/media/video-object-fit-change.html b/third_party/WebKit/LayoutTests/media/video-object-fit-change.html
index 0306d91..428e11f6 100644
--- a/third_party/WebKit/LayoutTests/media/video-object-fit-change.html
+++ b/third_party/WebKit/LayoutTests/media/video-object-fit-change.html
@@ -18,7 +18,7 @@
 
         function init()
         {
-            setSrcByTagName("video", "content/test.ogv");
+            setSrcByTagName("video", findMediaFile("video", "content/test"));
 
             var totalCount = document.getElementsByTagName('video').length;
             var count = totalCount;
diff --git a/third_party/WebKit/LayoutTests/media/video-object-fit-expected.html b/third_party/WebKit/LayoutTests/media/video-object-fit-expected.html
index b7fc684..8337ef4b 100644
--- a/third_party/WebKit/LayoutTests/media/video-object-fit-expected.html
+++ b/third_party/WebKit/LayoutTests/media/video-object-fit-expected.html
@@ -27,7 +27,7 @@
 
         function init()
         {
-            setSrcByTagName("video", "content/test.ogv");
+            setSrcByTagName("video", findMediaFile("video", "content/test"));
 
             var totalCount = document.getElementsByTagName('video').length;
             var count = totalCount;
diff --git a/third_party/WebKit/LayoutTests/media/video-object-fit.html b/third_party/WebKit/LayoutTests/media/video-object-fit.html
index 1b2cd49..67ad4d0f 100644
--- a/third_party/WebKit/LayoutTests/media/video-object-fit.html
+++ b/third_party/WebKit/LayoutTests/media/video-object-fit.html
@@ -18,7 +18,7 @@
 
         function init()
         {
-            setSrcByTagName("video", "content/test.ogv");
+            setSrcByTagName("video", findMediaFile("video", "content/test"));
 
             var totalCount = document.getElementsByTagName('video').length;
             var count = totalCount;
diff --git a/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html b/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html
index b95abc6..43bec2e 100644
--- a/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html
+++ b/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html
@@ -2,11 +2,12 @@
 <title>Test that pause() from EMPTY network state triggers load().</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE);
 
     video.onloadstart = t.step_func(function() {});
diff --git a/third_party/WebKit/LayoutTests/media/video-pause-immediately.html b/third_party/WebKit/LayoutTests/media/video-pause-immediately.html
index 9734c8b..ca82c4c 100644
--- a/third_party/WebKit/LayoutTests/media/video-pause-immediately.html
+++ b/third_party/WebKit/LayoutTests/media/video-pause-immediately.html
@@ -2,12 +2,13 @@
 <title>Test that pausing the media element has an immediate effect on the clock.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var timeAfterPause;
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.oncanplay = t.step_func(function() {
         video.play();
     });
diff --git a/third_party/WebKit/LayoutTests/media/video-persistence-expected.html b/third_party/WebKit/LayoutTests/media/video-persistence-expected.html
index 6d52a37..a6b60ca 100644
--- a/third_party/WebKit/LayoutTests/media/video-persistence-expected.html
+++ b/third_party/WebKit/LayoutTests/media/video-persistence-expected.html
@@ -29,6 +29,7 @@
 }
 
 </style>
+<script src='media-file.js'></script>
 <div id='player'>
   <div id='container'>
     <video></video>
@@ -37,7 +38,7 @@
 <div id='fs'>fullscreen</div>
 <script>
   var video = document.querySelector('video');
-  video.src = 'content/test.ogv';
+  video.src = findMediaFile('video', 'content/test');
 
   document.querySelector('#fs').addEventListener('click', e => {
     document.querySelector('#player').webkitRequestFullscreen();
diff --git a/third_party/WebKit/LayoutTests/media/video-persistence.html b/third_party/WebKit/LayoutTests/media/video-persistence.html
index a9112eb..2b13a5a2 100644
--- a/third_party/WebKit/LayoutTests/media/video-persistence.html
+++ b/third_party/WebKit/LayoutTests/media/video-persistence.html
@@ -20,6 +20,7 @@
 }
 
 </style>
+<script src='media-file.js'></script>
 <div id='player'>
   <div id='container'>
     <video></video>
@@ -31,7 +32,7 @@
 <div id='fs'>fullscreen</div>
 <script>
   var video = document.querySelector('video');
-  video.src = 'content/test.ogv';
+  video.src = findMediaFile('video', 'content/test');
 
   document.querySelector('#fs').addEventListener('click', e => {
     document.querySelector('#player').webkitRequestFullscreen();
diff --git a/third_party/WebKit/LayoutTests/media/video-play-empty-events.html b/third_party/WebKit/LayoutTests/media/video-play-empty-events.html
index 109e3eb..f761aa7 100644
--- a/third_party/WebKit/LayoutTests/media/video-play-empty-events.html
+++ b/third_party/WebKit/LayoutTests/media/video-play-empty-events.html
@@ -2,6 +2,7 @@
 <title>Test that play() from EMPTY network state triggers load() and async playing event.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -21,7 +22,7 @@
         assert_false(video.paused);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.play();
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-play-pause-events.html b/third_party/WebKit/LayoutTests/media/video-play-pause-events.html
index 8e586461..1bc3c2e 100644
--- a/third_party/WebKit/LayoutTests/media/video-play-pause-events.html
+++ b/third_party/WebKit/LayoutTests/media/video-play-pause-events.html
@@ -2,6 +2,7 @@
 <title>Test that calling play() and pause() triggers async play, timeupdate and pause events.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -30,7 +31,7 @@
         assert_true(video.paused);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.play();
     video.pause();
 });
diff --git a/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture-expected.txt b/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture-expected.txt
index e96aad1..2ae6bba 100644
--- a/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture-expected.txt
+++ b/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE ERROR: line 17: Uncaught (in promise) NotAllowedError: play() can only be initiated by a user gesture.
+CONSOLE ERROR: line 18: Uncaught (in promise) NotAllowedError: play() can only be initiated by a user gesture.
 This is a testharness.js-based test.
 Harness Error. harness_status.status = 1 , harness_status.message = play() can only be initiated by a user gesture.
 PASS Test that video play does not work unless a user gesture is involved in playing a video.
diff --git a/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture.html b/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture.html
index 5f91bff6..a2a4b7d 100644
--- a/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture.html
+++ b/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture.html
@@ -3,6 +3,7 @@
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 <script src="media-controls.js"></script>
+<script src="media-file.js"></script>
 <script>
 internals.settings.setAutoplayPolicy('user-gesture-required');
 </script>
@@ -34,6 +35,6 @@
         assert_true(video.paused);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-playbackrate.html b/third_party/WebKit/LayoutTests/media/video-playbackrate.html
index 922a1a6..8a29a4d 100644
--- a/third_party/WebKit/LayoutTests/media/video-playbackrate.html
+++ b/third_party/WebKit/LayoutTests/media/video-playbackrate.html
@@ -2,6 +2,7 @@
 <title>Test playbackRate and defaultPlaybackRate.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 // "playbackRate" should not change when play() is called.
@@ -26,7 +27,7 @@
         assert_equals(video.defaultPlaybackRate, 2);
 
         // Test extreme playback rates.
-
+        
         video.defaultPlaybackRate = Number.MIN_VALUE;
         assert_equals(video.defaultPlaybackRate, Number.MIN_VALUE);
 
@@ -77,6 +78,6 @@
         }
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-played-collapse.html b/third_party/WebKit/LayoutTests/media/video-played-collapse.html
index 763c955..426fcb7 100644
--- a/third_party/WebKit/LayoutTests/media/video-played-collapse.html
+++ b/third_party/WebKit/LayoutTests/media/video-played-collapse.html
@@ -2,6 +2,7 @@
 <title>Test media element's "played" attribute and range collapse.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="video-played.js"></script>
 <video></video>
 <script>
@@ -62,6 +63,6 @@
         waitForPauseAndContinue(t, null, true, expectedStartTimes, expectedEndTimes);
     }
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-played-ranges-1.html b/third_party/WebKit/LayoutTests/media/video-played-ranges-1.html
index 6146bbb..0d300309 100644
--- a/third_party/WebKit/LayoutTests/media/video-played-ranges-1.html
+++ b/third_party/WebKit/LayoutTests/media/video-played-ranges-1.html
@@ -2,6 +2,7 @@
 <title>Test media element's "played" attribute and ranges.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="video-played.js"></script>
 <video></video>
 <script>
@@ -52,6 +53,6 @@
         waitForPauseAndContinue(t, null, true, expectedStartTimes, expectedEndTimes);
     }
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-played-reset.html b/third_party/WebKit/LayoutTests/media/video-played-reset.html
index ce8bf88..fb426c95f 100644
--- a/third_party/WebKit/LayoutTests/media/video-played-reset.html
+++ b/third_party/WebKit/LayoutTests/media/video-played-reset.html
@@ -2,6 +2,7 @@
 <title>Test media element's "played" attribute.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script src="video-played.js"></script>
 <video></video>
 <script>
@@ -25,7 +26,7 @@
         timeRangeCount = currentTimeRange = 0;
         expectedStartTimes = [];
         expectedEndTimes = [];
-        video.src = "content/test.ogv";
+        video.src = findMediaFile("video", "content/test");
         video.oncanplay = t.step_func(jumpAndPlayFwd);
     }
 
@@ -48,6 +49,6 @@
         video.onloadstart = t.step_func_done(testRanges(expectedStartTimes, expectedEndTimes));
     }
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-plays-past-end-of-test.html b/third_party/WebKit/LayoutTests/media/video-plays-past-end-of-test.html
index 8297ca0..a8d2b5a 100644
--- a/third_party/WebKit/LayoutTests/media/video-plays-past-end-of-test.html
+++ b/third_party/WebKit/LayoutTests/media/video-plays-past-end-of-test.html
@@ -2,11 +2,12 @@
 <p>This test intentionally lets the video keep playing past end of test to ensure
 that shutdown is clean, since DumpRenderTree used to crash in this case.</p>
 <video autoplay></video>
+<script src="media-file.js"></script>
 <script>
 testRunner.dumpAsText();
 var video = document.querySelector("video");
 video.onplaying = function() {
     testRunner.notifyDone();
 };
-video.src = "content/test.ogv";
+video.src = findMediaFile("video", "content/test");
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-poster-delayed.html b/third_party/WebKit/LayoutTests/media/video-poster-delayed.html
index 723418f..9f378b3 100644
--- a/third_party/WebKit/LayoutTests/media/video-poster-delayed.html
+++ b/third_party/WebKit/LayoutTests/media/video-poster-delayed.html
@@ -2,6 +2,7 @@
 <title>Delayed load of poster should not overwrite intrinsic size of video.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -22,6 +23,6 @@
         assert_equals(video.videoHeight, 240);
     }
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html b/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html
index f139b58..8a72eb9 100644
--- a/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html
+++ b/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html
@@ -2,13 +2,14 @@
 <title>Test HTMLVideoElement's prefixed fullscreen API.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
     assert_true(video.webkitSupportsFullscreen);
     assert_false(video.webkitDisplayingFullscreen);
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 
     video.onloadeddata = t.step_func(function() {
         assert_true(video.webkitSupportsFullscreen);
diff --git a/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html b/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html
index be8fef5..5b7bde9 100644
--- a/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html
+++ b/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html
@@ -2,12 +2,13 @@
 <title>Test that a media element with "preload=none" doesn't fire a "stalled" event.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video preload="none"></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
     video.onsuspend = t.step_func_done();
     video.onstalled = t.unreached_func();
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-preload-none-to-metadata-after-load-crash.html b/third_party/WebKit/LayoutTests/media/video-preload-none-to-metadata-after-load-crash.html
index caa38f4..22fdd44b8 100644
--- a/third_party/WebKit/LayoutTests/media/video-preload-none-to-metadata-after-load-crash.html
+++ b/third_party/WebKit/LayoutTests/media/video-preload-none-to-metadata-after-load-crash.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>Setting preload=metadata after calling load() w/ preload=none</title>
+<script src="media-file.js"></script>
 <p>PASS if no crash in Debug.</p>
 <script>
 if (window.testRunner)
@@ -7,7 +8,7 @@
 
 var video = document.createElement('video');
 video.preload = "none";
-video.src = 'content/test.ogv';
+video.src = findMediaFile('video', 'content/test');
 video.load();
 video.preload = "metadata";
 </script>
diff --git a/third_party/WebKit/LayoutTests/media/video-preload.html b/third_party/WebKit/LayoutTests/media/video-preload.html
index df884904d..8492549 100644
--- a/third_party/WebKit/LayoutTests/media/video-preload.html
+++ b/third_party/WebKit/LayoutTests/media/video-preload.html
@@ -2,6 +2,7 @@
 <title>Test media loading behaviour with different "preload" values.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <script>
 var movies = [
     // should not buffer, "preload" is "none".
@@ -31,7 +32,7 @@
 
         setupAttribute("preload", movie.preload);
         setupAttribute("autoplay", movie.autoPlay);
-        video.src = "content/test.ogv";
+        video.src = findMediaFile("video", "content/test");
 
         if (movie.hasOwnProperty("play"))
             video.play();
diff --git a/third_party/WebKit/LayoutTests/media/video-remove-insert-repaints.html b/third_party/WebKit/LayoutTests/media/video-remove-insert-repaints.html
index 9b2c0db..9fdae11 100644
--- a/third_party/WebKit/LayoutTests/media/video-remove-insert-repaints.html
+++ b/third_party/WebKit/LayoutTests/media/video-remove-insert-repaints.html
@@ -31,7 +31,7 @@
             function start()
             {
                 video = document.getElementsByTagName('video')[0];
-                video.src = 'content/test.ogv';
+                video.src = findMediaFile('video', 'content/test');
                 video.addEventListener('canplaythrough', canplaythrough);
                 video.addEventListener('playing', playing);
                 video.addEventListener('seeked', seeked);
diff --git a/third_party/WebKit/LayoutTests/media/video-replaces-poster.html b/third_party/WebKit/LayoutTests/media/video-replaces-poster.html
index bf64056..069724d 100644
--- a/third_party/WebKit/LayoutTests/media/video-replaces-poster.html
+++ b/third_party/WebKit/LayoutTests/media/video-replaces-poster.html
@@ -1,10 +1,11 @@
 <!DOCTYPE html>
 <title>Test that video frame replaces poster on seeking.</title>
+<script src="media-file.js"></script>
 <script>
 function doSetup() {
     // TODO(srirama.m): convert this test to reference test.
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.addEventListener("canplaythrough", function () {
         video.currentTime = 1;  // so the snapshot always has the same frame.
     });
diff --git a/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html b/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html
index 1f9da0d..5f0c12e 100644
--- a/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html
+++ b/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html
@@ -2,6 +2,7 @@
 <title>Test that video(media) documents scale to fit undersized containers.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <iframe style="width: 200px; height: 200px;"></iframe>
 <script>
 async_test(function(t) {
@@ -17,6 +18,6 @@
         video.load();
     });
 
-    iframe.src = "content/counting.ogv";
+    iframe.src = findMediaFile("video", "content/counting");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-seek-by-small-increment.html b/third_party/WebKit/LayoutTests/media/video-seek-by-small-increment.html
index 3d81113..ecd3e79 100644
--- a/third_party/WebKit/LayoutTests/media/video-seek-by-small-increment.html
+++ b/third_party/WebKit/LayoutTests/media/video-seek-by-small-increment.html
@@ -2,6 +2,7 @@
 <title>Test seeking by very small increments.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -21,10 +22,9 @@
 
     function seekIncrement() {
         // We want to verify that seeking by an increment smaller than the test movie's
-        // time scale(the smallest unit of time in that file) succeeds. test.mp4 has a time
-        // scale of 1 millisecond, so start with that and decrease by half each time.
+        // time scale(the smallest unit of time in that file) succeeds. test.mp4 has a time // scale of 2500, 0.0004 seconds, so start with that and decrease by half each time.
         if (!increment)
-            increment = 0.001;
+            increment = 0.0004;
         else
             increment /= 2;
         return increment;
@@ -34,6 +34,6 @@
     video.onplay = t.step_func(function() {});
     video.onpause = t.step_func(function() {});
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-seek-past-end-paused.html b/third_party/WebKit/LayoutTests/media/video-seek-past-end-paused.html
index 06a6faf..50fac62 100644
--- a/third_party/WebKit/LayoutTests/media/video-seek-past-end-paused.html
+++ b/third_party/WebKit/LayoutTests/media/video-seek-past-end-paused.html
@@ -2,6 +2,7 @@
 <title>Test that seeking a paused video past its end sets currentTime to duration and leaves the video paused.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -35,7 +36,7 @@
         video.pause();
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.play();
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-seek-past-end-playing.html b/third_party/WebKit/LayoutTests/media/video-seek-past-end-playing.html
index 3c0c975..29bd0737 100644
--- a/third_party/WebKit/LayoutTests/media/video-seek-past-end-playing.html
+++ b/third_party/WebKit/LayoutTests/media/video-seek-past-end-playing.html
@@ -2,6 +2,7 @@
 <title>Test that seeking video with "loop" past it's end rewinds to the beginning and continues playback.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video loop></video>
 <script>
 async_test(function(t) {
@@ -34,6 +35,6 @@
         }
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html b/third_party/WebKit/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html
index 454ebb81..8593285 100644
--- a/third_party/WebKit/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html
+++ b/third_party/WebKit/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html
@@ -2,12 +2,13 @@
 <title>Test behavior when seeking to the duration and the playback rate equals 0.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.load();
     video.onseeking = t.step_func(function() {});
 
diff --git a/third_party/WebKit/LayoutTests/media/video-seekable.html b/third_party/WebKit/LayoutTests/media/video-seekable.html
index 0018dab..0625483 100644
--- a/third_party/WebKit/LayoutTests/media/video-seekable.html
+++ b/third_party/WebKit/LayoutTests/media/video-seekable.html
@@ -2,6 +2,7 @@
 <title>Test video "seekable" properties.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -23,6 +24,6 @@
         assert_throws("IndexSizeError", function() { video.seekable.end(1); });
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-seeking.html b/third_party/WebKit/LayoutTests/media/video-seeking.html
index 3218a96..1976f7c1 100644
--- a/third_party/WebKit/LayoutTests/media/video-seeking.html
+++ b/third_party/WebKit/LayoutTests/media/video-seeking.html
@@ -2,6 +2,7 @@
 <title>Test that seeking attribute is true immediately after a seek, goes back to false when seeking completes, and that a "seeked" event is fired for each seek.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -23,7 +24,7 @@
         assert_true(video.seeking);
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.currentTime = 0.5;
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html b/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html
index 6a272c5..c3f2a93e 100644
--- a/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html
+++ b/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html
@@ -2,6 +2,7 @@
 <title>Test that setting a non-zero rate causes an async timeupdate event.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -12,7 +13,7 @@
         video.playbackRate = 1;
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
     video.playbackRate = 0;
     video.play();
 });
diff --git a/third_party/WebKit/LayoutTests/media/video-single-valid-source.html b/third_party/WebKit/LayoutTests/media/video-single-valid-source.html
index 941c8f9..40ee975 100644
--- a/third_party/WebKit/LayoutTests/media/video-single-valid-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-single-valid-source.html
@@ -2,6 +2,7 @@
 <title>Test that a single valid "source" element loads correctly.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -9,7 +10,7 @@
 
     // The first source should load.
     var source = document.createElement("source");
-    source.src = "content/test.ogv";;
+    source.src = findMediaFile("video", "content/test");;
     video.appendChild(source);
 
     // The second source is bogus and won't load, but it should never be processed.
diff --git a/third_party/WebKit/LayoutTests/media/video-size.html b/third_party/WebKit/LayoutTests/media/video-size.html
index d7ff8f1fc..462bddd 100644
--- a/third_party/WebKit/LayoutTests/media/video-size.html
+++ b/third_party/WebKit/LayoutTests/media/video-size.html
@@ -2,6 +2,7 @@
 <title>Test "video" element size with and without "src" and "poster" attributes.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <body>
 <script>
 var movieInfo = [
@@ -34,7 +35,7 @@
         videoHeight: 0
     },
     {
-        src: "content/test.ogv",
+        src: "content/test",
         poster: "content/abe.png",
         description: "'poster' and 'src', should be 'video' size",
         width: 320,
@@ -43,7 +44,7 @@
         videoHeight: 240
     },
     {
-        src: "content/bogus.ogv",
+        src: "content/bogus",
         poster: "content/greenbox.png",
         description: "'poster' and invalid 'src', should be 'poster' size",
         width: 25,
@@ -73,7 +74,7 @@
             }
 
             if (movie.src)
-                video.src = movie.src;
+                video.src = findMediaFile("video", movie.src);
 
             if (movie.poster)
                 video.poster = movie.poster;
diff --git a/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html b/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html
index 3b004722..eb42abf5 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html
@@ -2,6 +2,7 @@
 <title>Test adding "source" after removing failed candidate loads media normally.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video>
     <source></source>
 </video>
@@ -13,7 +14,7 @@
     source.onerror = t.step_func(function() {
         video.removeChild(video.firstChild);
         var newSource = document.createElement("source");
-        newSource.src = "content/test.ogv";
+        newSource.src = findMediaFile("video", "content/test");
         video.appendChild(newSource);
         video.onloadedmetadata = t.step_func_done();
     });
diff --git a/third_party/WebKit/LayoutTests/media/video-source-error.html b/third_party/WebKit/LayoutTests/media/video-source-error.html
index 973d24b..46a5a54 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-error.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-error.html
@@ -2,11 +2,13 @@
 <title>Test "error" event are fired on "source" elements and not on "video" while processing invalid "source" elements.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video>
     <source id="missing-src" type="video/blahblah"></source>
     <source id="bogus-type" src="content/test.mp4" type="video/blahblah"></source>
     <source id="missing-file" src="content/error2.mpeg" type="video/mpeg"></source>
     <source id="format-error" src="content/unsupported_track.mov"></source>
+    <source id="supported-format-mp4" src="content/test.mp4" type="video/mp4; codecs=&quot;avc1.4D400C&quot;"></source>
     <source id="supported-format-ogv" src="content/test.ogv" type="video/ogg"></source>
 </video>
 <script>
@@ -32,7 +34,7 @@
 
     video.onloadeddata = t.step_func_done(function() {
         var url = video.currentSrc;
-        assert_equals(url.substr(url.lastIndexOf("/media/") + 7), "content/test.ogv");
+        assert_equals(url.substr(url.lastIndexOf("/media/") + 7), findMediaFile("video", "content/test"));
     });
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-source-load.html b/third_party/WebKit/LayoutTests/media/video-source-load.html
index a402de7..fb866a8 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-load.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-load.html
@@ -33,16 +33,16 @@
 
     // Add an invalid url to the first source so we test getting
     // an error event each time resource selection runs.
-    addSource("content/bogus.ogv");
-    addSource("content/test.ogv");
-    addSource("content/test.oga");
+    addSource("video", "content/bogus");
+    addSource("video", "content/test");
+    addSource("audio", "content/test");
 
     // test networkState.
     assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE);
 
-    function addSource(filePath) {
+    function addSource(type, name) {
         var source = document.createElement("source");
-        source.src = filePath;
+        source.src = findMediaFile(type, name);
         sourceUrls.push(source.src);
         source.type = mimeTypeForExtension(source.src.split(".").pop());
         video.appendChild(source);
diff --git a/third_party/WebKit/LayoutTests/media/video-source-moved.html b/third_party/WebKit/LayoutTests/media/video-source-moved.html
index d8ed856..2dadf69 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-moved.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-moved.html
@@ -56,7 +56,7 @@
 
         function addSource(index) {
             var source = document.createElement("source");
-            source.src = index + "-" + Date.now() + ".ogv";
+            source.src = findMediaFile("video", index + "-" + Date.now());
             source.type = mimeTypeForExtension(source.src.split(".").pop());
             video.appendChild(source);
 
diff --git a/third_party/WebKit/LayoutTests/media/video-source-removed.html b/third_party/WebKit/LayoutTests/media/video-source-removed.html
index 1c91335f..9b5350a6 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-removed.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-removed.html
@@ -23,7 +23,7 @@
 
         function addSource(index) {
             source = document.createElement("source");
-            source.src = index + "-" + Date.now() + ".ogv";
+            source.src = findMediaFile("video", index + "-" + Date.now());
             source.type = mimeTypeForExtension(source.src.split(".").pop());
             video.appendChild(source);
         }
diff --git a/third_party/WebKit/LayoutTests/media/video-source-type-params.html b/third_party/WebKit/LayoutTests/media/video-source-type-params.html
index d40e502..02c5b7d 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-type-params.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-type-params.html
@@ -2,6 +2,7 @@
 <title>Test "source" element "type" attribute with "params".</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video>
     <source src=content/bogus.mpeg type="video/blahblah">
     <source src=content/test.mp4 type="video/mpeg; codecs=&quot;avc1.4D400C&quot;">
@@ -14,7 +15,7 @@
 
     video.onloadstart = t.step_func_done(function() {
         var url = video.currentSrc;
-        assert_equals(url.substr(url.lastIndexOf("/media/") + 7), "content/test.ogv");
+        assert_equals(url.substr(url.lastIndexOf("/media/") + 7), findMediaFile("video", "content/test"));
     });
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-source-type.html b/third_party/WebKit/LayoutTests/media/video-source-type.html
index 06bc0ea9..7e156f7e 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-type.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-type.html
@@ -2,10 +2,12 @@
 <title>Test "source" element "type" attribute.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video>
     <source src=content/error.mpeg type=video/blahblah>
     <source src=test.mp4 type=video/x-chicken-face>
     <source src=test.ogv type=audio/x-higglety-pigglety>
+    <source src=content/test.mp4 type=video/mp4>
     <source src=content/test.ogv type=video/ogg>
     <source src=content/error2.mpeg type=video/mpeg>
 </video>
@@ -15,7 +17,7 @@
 
     video.onloadstart = t.step_func_done(function() {
         var url = video.currentSrc;
-        assert_equals(url.substr(url.lastIndexOf("/media/") + 7), "content/test.ogv");
+        assert_equals(url.substr(url.lastIndexOf("/media/") + 7), findMediaFile("video", "content/test"));
     });
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-source.html b/third_party/WebKit/LayoutTests/media/video-source.html
index d3529a6..1f4b6b5c 100644
--- a/third_party/WebKit/LayoutTests/media/video-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-source.html
@@ -2,6 +2,7 @@
 <title>Test "source" element.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video>
     <source></source>
 </video>
@@ -9,7 +10,7 @@
 async_test(function(t) {
     var video = document.querySelector("video");
     var source = document.querySelector("source");
-    var mediaFile = "content/test.ogv";
+    var mediaFile = findMediaFile("video", "content/test");
     source.src = mediaFile;
 
     video.onloadstart = t.step_func_done(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-src-blob.html b/third_party/WebKit/LayoutTests/media/video-src-blob.html
index b6f1d9d..e5d76d12e 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-blob.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-blob.html
@@ -2,6 +2,7 @@
 <title>This tests the ability of the "video" element to load blob URLs. In the browser, select a video file.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <input type="file">
 <video></video>
 <script>
@@ -15,7 +16,7 @@
         video.src = URL.createObjectURL(event.target.files[0]);
     });
 
-    eventSender.beginDragWithFiles(["content/test.ogv"]);
+    eventSender.beginDragWithFiles([findMediaFile("video", "content/test")]);
     var centerX = inputFile.offsetLeft + inputFile.offsetWidth / 2;
     var centerY = inputFile.offsetTop + inputFile.offsetHeight / 2;
     eventSender.mouseMoveTo(centerX, centerY);
diff --git a/third_party/WebKit/LayoutTests/media/video-src-change.html b/third_party/WebKit/LayoutTests/media/video-src-change.html
index efaa768..5cd6604b 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-change.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-change.html
@@ -2,6 +2,7 @@
 <title>Test that an invalid "src" fires an error event and changing "src" to a valid one triggers media load.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 // 1. Test that an invalid src attribute fires an error when the file fails to load.
@@ -22,7 +23,7 @@
             return;
         }
 
-        mediaFile = "content/counting.ogv";
+        mediaFile = findMediaFile("video", "content/counting");
         video.src = mediaFile;
     });
 
@@ -32,7 +33,7 @@
         assert_equals(url.substr(url.lastIndexOf("/media/")+7), "bogus");
         assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE);
         assert_equals(video.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
-        mediaFile = "content/test.ogv";
+        mediaFile = findMediaFile("video", "content/test");
         video.src = mediaFile;
     });
 
diff --git a/third_party/WebKit/LayoutTests/media/video-src-empty.html b/third_party/WebKit/LayoutTests/media/video-src-empty.html
index b22dccd..f75a6639b 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-empty.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-empty.html
@@ -2,6 +2,7 @@
 <title>Video element with src="" should invoke media element's load algorithm and should fire "error" event. Network state should be NETWORK_NO_SOURCE and the error code should be MEDIA_ERR_SRC_NOT_SUPPORTED.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -25,6 +26,6 @@
     });
 
     // video with valid non-empty "src" attribute.
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-src-invalid-remove.html b/third_party/WebKit/LayoutTests/media/video-src-invalid-remove.html
index 451f14e..5b4b715 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-invalid-remove.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-invalid-remove.html
@@ -2,6 +2,7 @@
 <title>Test that removing "src" attribute does not trigger load of "source" elements.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -17,7 +18,7 @@
 
     video.src = "bogus.mov";
     var source = document.createElement("source");
-    source.src = "content/test.ogv";
+    source.src = findMediaFile("video", "content/test");
     video.appendChild(source);
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-src-plus-source.html b/third_party/WebKit/LayoutTests/media/video-src-plus-source.html
index 646e914e..5b75d85 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-plus-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-plus-source.html
@@ -2,6 +2,7 @@
 <title>Test that a "source" element is not used when a bogus "src" attribute is present.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video>
     <source></source>
 </video>
@@ -22,7 +23,7 @@
         setTimeout(t.step_func_done(), 200) ;
     });
 
-    document.querySelector("source").src = "content/test.ogv";
+    document.querySelector("source").src = findMediaFile("video", "content/test");
     var mediaFile = "content/bogus.mpeg";
     video.src = mediaFile;
 });
diff --git a/third_party/WebKit/LayoutTests/media/video-src-remove.html b/third_party/WebKit/LayoutTests/media/video-src-remove.html
index 4b7e35f..0abcdaa1 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-remove.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-remove.html
@@ -2,6 +2,7 @@
 <title>Test that removing valid "src" attribute doesn't trigger load of "source" elements.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video>
     <source></source>
 </video>
@@ -25,8 +26,8 @@
         assert_false(isNaN(video.duration));
     }
 
-    document.querySelector("source").src = "content/counting.ogv";
-    var mediaFile = "content/test.ogv";
+    document.querySelector("source").src = findMediaFile("video", "content/counting");
+    var mediaFile = findMediaFile("video", "content/test");
     video.src = mediaFile;
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-src-set.html b/third_party/WebKit/LayoutTests/media/video-src-set.html
index 6c454d3..5bf8e00 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-set.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-set.html
@@ -2,11 +2,12 @@
 <title>Test that setting "src" attribute triggers load.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    var mediaFile = "content/test.ogv";
+    var mediaFile = findMediaFile("video", "content/test");
 
     video.onloadstart = t.step_func_done(function() {
         var url = video.currentSrc;
diff --git a/third_party/WebKit/LayoutTests/media/video-src-source.html b/third_party/WebKit/LayoutTests/media/video-src-source.html
index 36dede9..be84df7c 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-source.html
@@ -2,13 +2,14 @@
 <title>Test that a "source" element is not used when "src" attribute is set.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video>
     <source></source>
 </video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    var mediaFile = "content/test.ogv";
+    var mediaFile = findMediaFile("video", "content/test");
 
     video.onloadstart = t.step_func_done(function() {
         var url = video.currentSrc;
diff --git a/third_party/WebKit/LayoutTests/media/video-src.html b/third_party/WebKit/LayoutTests/media/video-src.html
index b86a37f6..35c6b5a 100644
--- a/third_party/WebKit/LayoutTests/media/video-src.html
+++ b/third_party/WebKit/LayoutTests/media/video-src.html
@@ -2,11 +2,12 @@
 <title>Verify media element's "src" attribute on "loadstart" event.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    var mediaFile = "content/test.ogv";
+    var mediaFile = findMediaFile("video", "content/test");
 
     video.onloadstart = t.step_func_done(function () {
         var url = video.currentSrc;
diff --git a/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html b/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html
index 70f2f0e..b5a3e4c 100644
--- a/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html
+++ b/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html
@@ -2,11 +2,12 @@
 <title>Test "timeupdate" events are posted while playing but not while paused.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
     var video = document.querySelector("video");
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 
     video.onplaying = t.step_func(function() {
         video.ontimeupdate = t.step_func(function() {
diff --git a/third_party/WebKit/LayoutTests/media/video-transformed.html b/third_party/WebKit/LayoutTests/media/video-transformed.html
index 247e6b81..1e64bf9 100644
--- a/third_party/WebKit/LayoutTests/media/video-transformed.html
+++ b/third_party/WebKit/LayoutTests/media/video-transformed.html
@@ -10,6 +10,6 @@
 &nbsp;<video style="transform:skew(20deg)"></video><br>
 <script>
 init();
-setSrcByTagName('video', 'content/test.ogv');
+setSrcByTagName('video', findMediaFile('video', 'content/test'));
 </script>
 </body>
diff --git a/third_party/WebKit/LayoutTests/media/video-volume.html b/third_party/WebKit/LayoutTests/media/video-volume.html
index 4575c1a..a447831a 100644
--- a/third_party/WebKit/LayoutTests/media/video-volume.html
+++ b/third_party/WebKit/LayoutTests/media/video-volume.html
@@ -2,6 +2,7 @@
 <title>Test "volume" attribute.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 async_test(function(t) {
@@ -27,6 +28,6 @@
         assert_throws("IndexSizeError", function() { video.volume = -0.5; });
     });
 
-    video.src = "content/test.ogv";
+    video.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/video-webkit-appearance-expected.html b/third_party/WebKit/LayoutTests/media/video-webkit-appearance-expected.html
index bc4fe520..75d747ed 100644
--- a/third_party/WebKit/LayoutTests/media/video-webkit-appearance-expected.html
+++ b/third_party/WebKit/LayoutTests/media/video-webkit-appearance-expected.html
@@ -1,9 +1,10 @@
 <!DOCTYPE html>
 <title>video with -webkit-appearance media-play-button</title>
+<script src="media-file.js"></script>
 <video></video>
 <script>
 var video = document.querySelector('video');
-video.src = 'content/test.ogv';
+video.src = findMediaFile('video', 'content/test');
 
 if (window.testRunner) {
   testRunner.waitUntilDone();
diff --git a/third_party/WebKit/LayoutTests/media/video-webkit-appearance.html b/third_party/WebKit/LayoutTests/media/video-webkit-appearance.html
index b79cd12..1633274e 100644
--- a/third_party/WebKit/LayoutTests/media/video-webkit-appearance.html
+++ b/third_party/WebKit/LayoutTests/media/video-webkit-appearance.html
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <title>video with -webkit-appearance media-play-button</title>
+<script src="media-file.js"></script>
 <style>
 video {
   -webkit-appearance: media-play-button;
@@ -8,7 +9,7 @@
 <video></video>
 <script>
 var video = document.querySelector('video');
-video.src = 'content/test.ogv';
+video.src = findMediaFile('video', 'content/test');
 
 if (window.testRunner) {
   testRunner.waitUntilDone();
diff --git a/third_party/WebKit/LayoutTests/media/video-zoom-controls.html b/third_party/WebKit/LayoutTests/media/video-zoom-controls.html
index 290ebcb..bd05f35 100644
--- a/third_party/WebKit/LayoutTests/media/video-zoom-controls.html
+++ b/third_party/WebKit/LayoutTests/media/video-zoom-controls.html
@@ -13,7 +13,7 @@
     <script src="media-file.js"></script>
     <script src="video-paint-test.js"></script>
 </head>
-<body onload="setSrcByTagName('video', 'content/test.ogv'); init()">
+<body onload="setSrcByTagName('video', findMediaFile('video', 'content/test')); init()">
     <p>Zoomed video with controls.</p>
     <video width="160" height="120" controls></video>
     <video class="rotated" width="160" height="120" controls></video>
diff --git a/third_party/WebKit/LayoutTests/media/video-zoom.html b/third_party/WebKit/LayoutTests/media/video-zoom.html
index 77841eb..2fe261d 100644
--- a/third_party/WebKit/LayoutTests/media/video-zoom.html
+++ b/third_party/WebKit/LayoutTests/media/video-zoom.html
@@ -8,7 +8,7 @@
 
         function init()
         {
-            setSrcByTagName("video", "content/test.ogv");
+            setSrcByTagName("video", findMediaFile("video", "content/test"));
 
             var totalCount = document.getElementsByTagName('video').length;
             var count = totalCount;
@@ -21,8 +21,8 @@
 
             if (window.testRunner) {
                 testRunner.waitUntilDone();
-                setTimeout(function() {
-                    document.body.appendChild(document.createTextNode('FAIL'));
+                setTimeout(function() { 
+                    document.body.appendChild(document.createTextNode('FAIL')); 
                     if (window.testRunner)
                         testRunner.notifyDone();
                 }, 1500);
diff --git a/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html b/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html
index 7296600..1f70d53 100644
--- a/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html
+++ b/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html
@@ -2,6 +2,7 @@
 <title>This tests that a standalone media document has viewport settings.</title>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
 <iframe></iframe>
 <script>
 async_test(function(t) {
@@ -13,6 +14,6 @@
         assert_equals(metaElement.content, "width=device-width");
     });
 
-    iframe.src = "content/test.ogv";
+    iframe.src = findMediaFile("video", "content/test");
 });
 </script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/image/canvas-composite-repaint-by-all-imagesource.html b/third_party/WebKit/LayoutTests/paint/invalidation/image/canvas-composite-repaint-by-all-imagesource.html
index 95435fe..5f6a1c1 100644
--- a/third_party/WebKit/LayoutTests/paint/invalidation/image/canvas-composite-repaint-by-all-imagesource.html
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/image/canvas-composite-repaint-by-all-imagesource.html
@@ -32,8 +32,8 @@
     <div><canvas id = "source-canvas"></canvas></div>
     <div>Test Video</div>
     <div><video id="video">
-      <source src="../../../fast/canvas/resources/canvas_video.webm" type='video/webm' />
       <source src="../../../fast/canvas/resources/canvas_video.mp4"  type='video/mp4' />
+      <source src="../../../fast/canvas/resources/canvas_video.webm" type='video/webm' />
       <source src="../../../fast/canvas/resources/canvas_video.ogv"  type='video/ogg' />
     </video></div>
     <script src="../resources/text-based-repaint.js"></script>
diff --git a/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background-expected.html b/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background-expected.html
index 10e71be..819db39 100644
--- a/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background-expected.html
+++ b/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background-expected.html
@@ -8,7 +8,7 @@
     <script src="../../../fullscreen/full-screen-test.js"></script>
     <script src="../../../media/media-file.js"></script>
     <script>
-        setSrcById("video", "../../../media/content/test.ogv");
+        setSrcById("video", findMediaFile("video", "../../../media/content/test"));
         var video = document.getElementById('video');
         // Bail out early if the full screen API is not enabled or is missing:
         if (Element.prototype.webkitRequestFullScreen == undefined) {
diff --git a/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background.html b/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background.html
index 02e7efa..77b31f0 100644
--- a/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background.html
+++ b/third_party/WebKit/LayoutTests/virtual/android/fullscreen/video-fixed-background.html
@@ -8,7 +8,7 @@
     <script src="../../../fullscreen/full-screen-test.js"></script>
     <script src="../../../media/media-file.js"></script>
     <script>
-        setSrcById("video", "../../../media/content/test.ogv");
+        setSrcById("video", findMediaFile("video", "../../../media/content/test"));
         var video = document.getElementById('video');
         // Bail out early if the full screen API is not enabled or is missing:
         if (Element.prototype.webkitRequestFullScreen == undefined) {
diff --git a/third_party/WebKit/ManualTests/media-controls.html b/third_party/WebKit/ManualTests/media-controls.html
index 4ab7ba7b..8b0fe0c8b 100644
--- a/third_party/WebKit/ManualTests/media-controls.html
+++ b/third_party/WebKit/ManualTests/media-controls.html
@@ -68,6 +68,7 @@
 
 </style>
 <!-- LayoutTests location is hard-coded to avoid duplication of code. -->
+<script src="http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/media-file.js"></script>
 <script>
 
 var MEDIA_FILES_LOCATION = 'http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/content';
@@ -194,8 +195,8 @@
 function configureMediaFiles()
 {
     MEDIA_FILES = {
-        'audio': absoluteUrl(MEDIA_FILES_LOCATION + '/test.wav'),
-        'video': absoluteUrl(MEDIA_FILES_LOCATION + '/test.ogv'),
+        'audio': absoluteUrl(findMediaFile('audio', MEDIA_FILES_LOCATION + '/test')),
+        'video': absoluteUrl(findMediaFile('video', MEDIA_FILES_LOCATION + '/test')),
         'video-captioned': absoluteUrl(MEDIA_FILES_LOCATION + '/counting-captioned.mov')
     }
 
diff --git a/third_party/WebKit/ManualTests/media-default-playback-rate.html b/third_party/WebKit/ManualTests/media-default-playback-rate.html
index dfc18885..b980edc 100644
--- a/third_party/WebKit/ManualTests/media-default-playback-rate.html
+++ b/third_party/WebKit/ManualTests/media-default-playback-rate.html
@@ -2,6 +2,7 @@
 <html>
     <head>
         <!-- LayoutTests location is hard-coded to avoid duplication of code. -->
+        <script src="http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/media-file.js"></script>
         <script src="http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/video-test.js"></script>
 
         <script>
@@ -46,7 +47,7 @@
                 video.addEventListener('playing', playing);
 
                 // Use the video file from the svn repository to avoid duplicating the file.
-                video.src = absoluteUrl('http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/content/test.ogv');
+                video.src = absoluteUrl(findMediaFile('video', 'http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/content/test'));
                 testRates();
             }
 
@@ -67,7 +68,7 @@
     </head>
 
     <body onload="start()">
-
+        
         <video controls > </video>
         <ul>
             <li>The current 'playbackRate' and 'defaultPlaybackRate' should be logged every time either changes.</li>
diff --git a/third_party/WebKit/ManualTests/media-muted.html b/third_party/WebKit/ManualTests/media-muted.html
index 30a36ab..40e4e418 100644
--- a/third_party/WebKit/ManualTests/media-muted.html
+++ b/third_party/WebKit/ManualTests/media-muted.html
@@ -16,7 +16,8 @@
 
             // Mute first
             vid.muted = true;
-            vid.src = "https://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/content/audio-describes-video.mp4"
+
+            vid.src = "http://src.chromium.org/svn/trunk/src/chrome/test/data/media/" + findMediaFile("video", "bear");
         }
     </script>