Bug 1070146 - Test resource timing info for script resources. r=bz
authorValentin Gosu <valentin.gosu@gmail.com>
Wed, 24 Sep 2014 01:51:54 +0300
changeset 230377 da5c4c9ee9b646116e96328b2e00a94d99d435fa
parent 230376 d53b25dcf2d7e525b6cfff8304839ae4a5168842
child 230378 007c2dea78c1e7da864f848a3f85dc4aecc72fa8
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1070146
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1070146 - Test resource timing info for script resources. r=bz
dom/tests/mochitest/general/mochitest.ini
dom/tests/mochitest/general/resource_timing.js
dom/tests/mochitest/general/resource_timing_cross_origin.html
--- a/dom/tests/mochitest/general/mochitest.ini
+++ b/dom/tests/mochitest/general/mochitest.ini
@@ -27,16 +27,17 @@ support-files =
   res5.resource
   res5.resource^headers^
   res6.resource
   res6.resource^headers^
   res7.resource
   res7.resource^headers^
   res8.resource
   res8.resource^headers^
+  resource_timing.js
 
 [test_497898.html]
 skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || toolkit == 'android' #Bug 931116, b2g desktop specific, initial triage
 [test_bug504220.html]
 [test_bug628069_1.html]
 skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
 [test_bug628069_2.html]
 [test_bug631440.html]
new file mode 100644
--- a/dom/tests/mochitest/general/resource_timing_cross_origin.html
+++ b/dom/tests/mochitest/general/resource_timing_cross_origin.html
@@ -81,16 +81,20 @@ function firstCheck() {
   entries = window.performance.getEntriesByName("http://test1.example.com/tests/dom/tests/mochitest/general/res7.resource");
   ok(!!entries[0], "cross origin res7.resource is missing from entries");
   checkCrossOrigin(entries[0]);
 
   entries = window.performance.getEntriesByName("http://test1.example.com/tests/dom/tests/mochitest/general/res8.resource");
   ok(!!entries[0], "redirected res8.resource is missing from entries");
   checkRedirectCrossOriginResourceSameOrigin(entries[0]);
 
+  entries = window.performance.getEntriesByName("http://mochi.test:8888/tests/dom/tests/mochitest/general/resource_timing.js");
+  ok(!!entries[0], "same origin resource_timing.js is missing from entries");
+  checkSameOrigin(entries[0]);
+
   is(bufferFullCounter, expectedBufferFullEvents, "Buffer full was called");
   finishTests();
 }
 
 function checkEntry(entry, checks) {
   // If the entry is undefined, we return early so we don't get a JS error
   if (entry == undefined)
     return;
@@ -171,12 +175,13 @@ function finishTests() {
     <object data="http://test1.example.com/tests/dom/tests/mochitest/general/res1.resource"> <!-- cross origin, Timing-Allow-Origin: * header -->
     <object data="http://test1.example.com/tests/dom/tests/mochitest/general/res2.resource"> <!-- cross origin redirect to test2.example.com, no header -->
     <object data="http://test1.example.com/tests/dom/tests/mochitest/general/res3.resource"> <!-- cross origin, Timing-Allow-Origin: http://mochi.test:8888 header -->
     <object data="http://test1.example.com/tests/dom/tests/mochitest/general/res4.resource"> <!-- cross origin redirect to mochi.test:8888/.../res1.resource, Timing-Allow-Origin: * -->
     <object data="http://test1.example.com/tests/dom/tests/mochitest/general/res5.resource"> <!-- cross origin, Timing-Allow-Origin: http://mochi.test:8889 -->
     <object data="http://test1.example.com/tests/dom/tests/mochitest/general/res6.resource"> <!-- cross origin, Timing-Allow-Origin: "" (empty string) -->
     <object data="http://test1.example.com/tests/dom/tests/mochitest/general/res7.resource"> <!-- cross origin, Timing-Allow-Origin: http://mochi.test:8888 http://test1.com header -->
     <object data="http://test1.example.com/tests/dom/tests/mochitest/general/res8.resource"> <!-- double cross origin redirect -->
+    <script type="text/javascript" src="http://mochi.test:8888/tests/dom/tests/mochitest/general/resource_timing.js"></script> <!-- same origin script -->
   </div>
 </body>
 
 </html>