11cb0ef41Sopenharmony_ci test(function () { 21cb0ef41Sopenharmony_ci assert_equals(typeof self.performance, "object"); 31cb0ef41Sopenharmony_ci assert_equals(typeof self.performance.getEntriesByType, "function"); 41cb0ef41Sopenharmony_ci var lowerList = self.performance.getEntriesByType("resource"); 51cb0ef41Sopenharmony_ci var upperList = self.performance.getEntriesByType("RESOURCE"); 61cb0ef41Sopenharmony_ci var mixedList = self.performance.getEntriesByType("ReSoUrCe"); 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ci assert_not_equals(lowerList.length, 0, "Resource entries exist"); 91cb0ef41Sopenharmony_ci assert_equals(upperList.length, 0, "getEntriesByType('RESOURCE').length"); 101cb0ef41Sopenharmony_ci assert_equals(mixedList.length, 0, "getEntriesByType('ReSoUrCe').length"); 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci }, "getEntriesByType values are case sensitive"); 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ci test(function () { 151cb0ef41Sopenharmony_ci assert_equals(typeof self.performance, "object"); 161cb0ef41Sopenharmony_ci assert_equals(typeof self.performance.getEntriesByName, "function"); 171cb0ef41Sopenharmony_ci var origin = self.location.protocol + "//" + self.location.host; 181cb0ef41Sopenharmony_ci var location1 = origin.toUpperCase() + "/resources/testharness.js"; 191cb0ef41Sopenharmony_ci var location2 = self.location.protocol + "//" 201cb0ef41Sopenharmony_ci + self.location.host.toUpperCase() + "/resources/testharness.js"; 211cb0ef41Sopenharmony_ci var lowerList = self.performance.getEntriesByName(origin + "/resources/testharness.js"); 221cb0ef41Sopenharmony_ci var upperList = self.performance.getEntriesByName(location1); 231cb0ef41Sopenharmony_ci var mixedList = self.performance.getEntriesByName(location2); 241cb0ef41Sopenharmony_ci 251cb0ef41Sopenharmony_ci assert_equals(lowerList.length, 1, "Resource entry exist"); 261cb0ef41Sopenharmony_ci assert_equals(upperList.length, 0, "getEntriesByName('" + location1 + "').length"); 271cb0ef41Sopenharmony_ci assert_equals(mixedList.length, 0, "getEntriesByName('" + location2 + "').length"); 281cb0ef41Sopenharmony_ci 291cb0ef41Sopenharmony_ci }, "getEntriesByName values are case sensitive"); 301cb0ef41Sopenharmony_ci 311cb0ef41Sopenharmony_ci async_test(function (t) { 321cb0ef41Sopenharmony_ci // Test type/buffered case sensitivity. 331cb0ef41Sopenharmony_ci observer = new PerformanceObserver( 341cb0ef41Sopenharmony_ci t.step_func(function (entryList, obs) { 351cb0ef41Sopenharmony_ci assert_unreached("Observer(type) should not be called."); 361cb0ef41Sopenharmony_ci }) 371cb0ef41Sopenharmony_ci ); 381cb0ef41Sopenharmony_ci observer.observe({type: "Mark"}); 391cb0ef41Sopenharmony_ci observer.observe({type: "Measure"}); 401cb0ef41Sopenharmony_ci observer.observe({type: "MARK"}); 411cb0ef41Sopenharmony_ci observer.observe({type: "MEASURE"}); 421cb0ef41Sopenharmony_ci observer.observe({type: "Mark", buffered: true}); 431cb0ef41Sopenharmony_ci observer.observe({type: "Measure", buffered: true}); 441cb0ef41Sopenharmony_ci observer.observe({type: "MARK", buffered: true}); 451cb0ef41Sopenharmony_ci observer.observe({type: "MEASURE", buffered: true}); 461cb0ef41Sopenharmony_ci self.performance.mark("mark1"); 471cb0ef41Sopenharmony_ci self.performance.measure("measure1"); 481cb0ef41Sopenharmony_ci 491cb0ef41Sopenharmony_ci // Test entryTypes case sensitivity. 501cb0ef41Sopenharmony_ci observer = new PerformanceObserver( 511cb0ef41Sopenharmony_ci t.step_func(function (entryList, obs) { 521cb0ef41Sopenharmony_ci assert_unreached("Observer(entryTypes) should not be called."); 531cb0ef41Sopenharmony_ci }) 541cb0ef41Sopenharmony_ci ); 551cb0ef41Sopenharmony_ci observer.observe({entryTypes: ["Mark", "Measure"]}); 561cb0ef41Sopenharmony_ci observer.observe({entryTypes: ["MARK", "MEASURE"]}); 571cb0ef41Sopenharmony_ci self.performance.mark("mark1"); 581cb0ef41Sopenharmony_ci self.performance.measure("measure1"); 591cb0ef41Sopenharmony_ci 601cb0ef41Sopenharmony_ci t.step_timeout(function() { 611cb0ef41Sopenharmony_ci t.done(); 621cb0ef41Sopenharmony_ci }, 1000); 631cb0ef41Sopenharmony_ci 641cb0ef41Sopenharmony_ci }, "observe() and case sensitivity for types/entryTypes and buffered."); 65