Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/cache-storage/serviceworker/credentials.html

Issue 2547023002: Import wpt@3c8896ae408c8fd594979da7c99970029e7856a7 (Closed)
Patch Set: Modify TestExpectations or download new baselines for tests. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>Cache Storage: Verify credentials are respected by Cache operations</titl e>
4 <link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-storage">
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
7 <script src="../../service-worker/resources/test-helpers.sub.js"></script>
8 <style>iframe { display: none; }</style>
9 <script>
10
11 var worker = "../resources/credentials-worker.js";
12 var scope = "../resources/credentials-iframe.html";
13 promise_test(function(t) {
14 return self.caches.delete('credentials')
15 .then(function() {
16 return service_worker_unregister_and_register(t, worker, scope)
17 })
18 .then(function(reg) {
19 return wait_for_state(t, reg.installing, 'activated');
20 })
21 .then(function() {
22 return with_iframe(scope);
23 })
24 .then(function(frame) {
25 frame.contentWindow.postMessage([
26 {name: 'file.txt', username: 'aa', password: 'bb'},
27 {name: 'file.txt', username: 'cc', password: 'dd'},
28 {name: 'file.txt'}
29 ], '*');
30 return new Promise(function(resolve, reject) {
31 window.onmessage = t.step_func(function(e) {
32 resolve(e.data);
33 });
34 });
35 })
36 .then(function(data) {
37 assert_equals(data.length, 3, 'three entries should be present');
38 assert_equals(data.filter(function(url) { return /@/.test(url); }).length, 2,
39 'two entries should contain credentials');
40 assert_true(data.some(function(url) { return /aa:bb@/.test(url); }),
41 'entry with credentials aa:bb should be present');
42 assert_true(data.some(function(url) { return /cc:dd@/.test(url); }),
43 'entry with credentials cc:dd should be present');
44 });
45 }, "Cache API matching includes credentials");
46 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698