Bug 1564235 - P6 Enable partial web-platform tests for navigationPreloadManager. r=dom-worker-reviewers,asuth

Depends on D116918

Differential Revision: https://phabricator.services.mozilla.com/D117288
This commit is contained in:
Eden Chuang 2021-06-10 06:01:28 +00:00
parent 144f9f3b9c
commit a876ffd06b
4 changed files with 11 additions and 15 deletions

View File

@ -171,6 +171,9 @@ TEST(ServiceWorkerRegistrar, TestReadData)
buffer.AppendLiteral("\n");
buffer.AppendInt(0);
buffer.AppendLiteral("\n");
buffer.AppendInt(0);
buffer.AppendLiteral("\n");
buffer.AppendLiteral("true\n");
buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
buffer.AppendLiteral("\n");
@ -186,6 +189,9 @@ TEST(ServiceWorkerRegistrar, TestReadData)
buffer.AppendLiteral("\n");
buffer.AppendInt(ts);
buffer.AppendLiteral("\n");
buffer.AppendInt(1);
buffer.AppendLiteral("\n");
buffer.AppendLiteral("false\n");
buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
ASSERT_TRUE(CreateFile(buffer))
@ -218,6 +224,8 @@ TEST(ServiceWorkerRegistrar, TestReadData)
ASSERT_EQ((int64_t)0, data[0].currentWorkerInstalledTime());
ASSERT_EQ((int64_t)0, data[0].currentWorkerActivatedTime());
ASSERT_EQ((int64_t)0, data[0].lastUpdateTime());
ASSERT_EQ(false, data[0].navigationPreloadState().enabled());
ASSERT_STREQ("true", data[0].navigationPreloadState().headerValue().get());
const mozilla::ipc::PrincipalInfo& info1 = data[1].principal();
ASSERT_EQ(info1.type(), mozilla::ipc::PrincipalInfo::TContentPrincipalInfo)
@ -238,6 +246,8 @@ TEST(ServiceWorkerRegistrar, TestReadData)
ASSERT_EQ((int64_t)ts, data[1].currentWorkerInstalledTime());
ASSERT_EQ((int64_t)ts, data[1].currentWorkerActivatedTime());
ASSERT_EQ((int64_t)ts, data[1].lastUpdateTime());
ASSERT_EQ(true, data[1].navigationPreloadState().enabled());
ASSERT_STREQ("false", data[1].navigationPreloadState().headerValue().get());
}
TEST(ServiceWorkerRegistrar, TestDeleteData)

View File

@ -1,3 +1,4 @@
prefs: [dom.serviceWorkers.navigationPreload.enabled:true]
implementation-status: backlog
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1564235
leak-threshold: [tab:102400]

View File

@ -1,11 +0,0 @@
[get-state.https.html]
expected: TIMEOUT
[getState]
expected: FAIL
[getState from a worker]
expected: TIMEOUT
[no active worker]
expected: NOTRUN

View File

@ -1,4 +0,0 @@
[navigationPreload.https.html]
[The navigationPreload attribute must return service worker registration's NavigationPreloadManager object.]
expected: FAIL