Bug 1230042 - Fix clients-matchall-include-uncontrolled.https.html by sorting the clients array and ignoring non-test clients; r=bkelly

This commit is contained in:
Ehsan Akhgari 2015-12-14 15:00:54 -05:00
parent 7963856ba1
commit e894f92893
2 changed files with 5 additions and 5 deletions

View File

@ -1,3 +0,0 @@
[clients-matchall-include-uncontrolled.https.html]
type: testharness
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1230042

View File

@ -48,10 +48,13 @@ function test_matchall(frame, expected, query_options) {
return new Promise(function(resolve, reject) {
var channel = new MessageChannel();
channel.port1.onmessage = function(e) {
// Ignore hidden clients which may be coming from background tabs.
// Ignore hidden clients which may be coming from background tabs, or
// clients unrelated to this test.
var data = e.data.filter(function(info) {
return info[0] == 'visible';
return info[0] == 'visible' &&
info[2].indexOf('service-worker') > -1;
});
data.sort(function(a, b) { return a[2] > b[2] ? 1 : -1; });
assert_equals(data.length, expected.length);
for (var i = 0; i < data.length; i++)
assert_array_equals(data[i], expected[i]);