Changeset 249626 in webkit
- Timestamp:
- Sep 7, 2019 10:26:51 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r249625 r249626 1 2019-09-07 Chris Dumez <cdumez@apple.com> 2 3 Rewrite http/tests/workers/service/serviceworker-private-browsing.https.html as an API test 4 https://bugs.webkit.org/show_bug.cgi?id=201574 5 6 Reviewed by Alex Christensen. 7 8 Drop legacy test which was replaced by an API test. 9 10 * http/tests/workers/service/serviceworker-private-browsing-worker.js: Removed. 11 * http/tests/workers/service/serviceworker-private-browsing.https-expected.txt: Removed. 12 * http/tests/workers/service/serviceworker-private-browsing.https.html: Removed. 13 1 14 2019-09-07 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/LayoutTests/platform/gtk/TestExpectations
r249416 r249626 1045 1045 webkit.org/b/175419 http/tests/workers/service/controller-change.html [ Skip ] 1046 1046 webkit.org/b/175419 http/tests/workers/service/no-page-cache-when-controlled.html [ Skip ] 1047 webkit.org/b/175419 http/tests/workers/service/serviceworker-private-browsing.https.html [ Skip ]1048 1047 webkit.org/b/175419 http/wpt/service-workers/persistent-importScripts.html [ Failure ] 1049 1048 webkit.org/b/175419 imported/w3c/web-platform-tests/service-workers/service-worker/activation.https.html [ Skip ] -
trunk/Source/WebKit/ChangeLog
r249624 r249626 1 2019-09-07 Chris Dumez <cdumez@apple.com> 2 3 Rewrite http/tests/workers/service/serviceworker-private-browsing.https.html as an API test 4 https://bugs.webkit.org/show_bug.cgi?id=201574 5 6 Reviewed by Alex Christensen. 7 8 Update Service Workers so that they obey the "secureContextChecksEnabled" preference. 9 This was needed to allow my service worker to access self.caches in my API test. 10 11 * WebProcess/Storage/WebSWContextManagerConnection.cpp: 12 (WebKit::WebSWContextManagerConnection::updatePreferencesStore): 13 1 14 2019-09-07 Tim Horton <timothy_horton@apple.com> 2 15 -
trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp
r249501 r249626 114 114 RuntimeEnabledFeatures::sharedFeatures().setServerTimingEnabled(store.getBoolValueForKey(WebPreferencesKey::serverTimingEnabledKey())); 115 115 RuntimeEnabledFeatures::sharedFeatures().setIsSecureContextAttributeEnabled(store.getBoolValueForKey(WebPreferencesKey::isSecureContextAttributeEnabledKey())); 116 RuntimeEnabledFeatures::sharedFeatures().setSecureContextChecksEnabled(store.getBoolValueForKey(WebPreferencesKey::secureContextChecksEnabledKey())); 116 117 117 118 m_storageBlockingPolicy = static_cast<SecurityOrigin::StorageBlockingPolicy>(store.getUInt32ValueForKey(WebPreferencesKey::storageBlockingPolicyKey())); -
trunk/Tools/ChangeLog
r249625 r249626 1 2019-09-07 Chris Dumez <cdumez@apple.com> 2 3 Rewrite http/tests/workers/service/serviceworker-private-browsing.https.html as an API test 4 https://bugs.webkit.org/show_bug.cgi?id=201574 5 6 Reviewed by Alex Christensen. 7 8 Rewrite http/tests/workers/service/serviceworker-private-browsing.https.html as an API test so that 9 we truly test private browsing. testRunner.setPrivateBrowsingEnabled_DEPRECATED() is a hack which 10 does not work well for WK2. 11 12 * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm: 13 1 14 2019-09-07 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm
r249622 r249626 1350 1350 } 1351 1351 1352 static const char* serviceWorkerCacheAccessEphemeralSessionMainBytes = R"SWRESOURCE( 1353 <script> 1354 try { 1355 navigator.serviceWorker.addEventListener("message", (event) => { 1356 webkit.messageHandlers.sw.postMessage(event.data); 1357 }); 1358 1359 navigator.serviceWorker.register("serviceworker-private-browsing-worker.js", { scope : "my private backyard" }).then((registration) => { 1360 activeWorker = registration.installing; 1361 activeWorker.addEventListener('statechange', () => { 1362 if (activeWorker.state === "activated") { 1363 activeWorker.postMessage("TESTCACHE"); 1364 } 1365 }); 1366 }); 1367 } catch (e) { 1368 webkit.messageHandlers.sw.postMessage("" + e); 1369 } 1370 </script> 1371 )SWRESOURCE"; 1372 1373 static const char* serviceWorkerCacheAccessEphemeralSessionSWBytes = R"SWRESOURCE( 1374 self.addEventListener("message", (event) => { 1375 try { 1376 self.caches.keys().then((keys) => { 1377 event.source.postMessage(keys.length === 0 ? "PASS" : "FAIL: caches is not empty, got: " + JSON.stringify(keys)); 1378 }); 1379 } catch (e) { 1380 event.source.postMessage("" + e); 1381 } 1382 }); 1383 )SWRESOURCE"; 1384 1385 // Opens a cache in the default session and checks that an ephemeral service worker 1386 // does not have access to it. 1387 TEST(ServiceWorkers, ServiceWorkerCacheAccessEphemeralSession) 1388 { 1389 [WKWebsiteDataStore _allowWebsiteDataRecordsForAllOrigins]; 1390 1391 // Start with a clean slate data store 1392 [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() { 1393 done = true; 1394 }]; 1395 TestWebKitAPI::Util::run(&done); 1396 done = false; 1397 1398 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 1399 setConfigurationInjectedBundlePath(configuration.get()); 1400 1401 auto defaultPreferences = [configuration preferences]; 1402 [defaultPreferences _setSecureContextChecksEnabled:NO]; 1403 1404 auto handler = adoptNS([[SWSchemes alloc] init]); 1405 handler->resources.set("sw://host/openCache.html", ResourceInfo { @"text/html", "foo" }); 1406 handler->resources.set("sw://host/main.html", ResourceInfo { @"text/html", serviceWorkerCacheAccessEphemeralSessionMainBytes }); 1407 handler->resources.set("sw://host/serviceworker-private-browsing-worker.js", ResourceInfo { @"application/javascript", serviceWorkerCacheAccessEphemeralSessionSWBytes }); 1408 [configuration setURLSchemeHandler:handler.get() forURLScheme:@"SW"]; 1409 1410 auto defaultWebView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 1411 NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"sw://host/openCache.html"]]; 1412 [defaultWebView synchronouslyLoadRequest:request]; 1413 1414 bool openedCache = false; 1415 [defaultWebView evaluateJavaScript:@"self.caches.open('test');" completionHandler: [&] (id innerText, NSError *error) { 1416 openedCache = true; 1417 }]; 1418 TestWebKitAPI::Util::run(&openedCache); 1419 1420 configuration.get().websiteDataStore = [WKWebsiteDataStore nonPersistentDataStore]; 1421 1422 auto messageHandler = adoptNS([[SWMessageHandlerForCacheStorage alloc] init]); 1423 [[configuration userContentController] addScriptMessageHandler:messageHandler.get() name:@"sw"]; 1424 1425 auto ephemeralWebView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 1426 request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"sw://host/main.html"]]; 1427 1428 [ephemeralWebView loadRequest:request]; 1429 TestWebKitAPI::Util::run(&done); 1430 done = false; 1431 } 1432 1352 1433 static const char* regularPageGrabbingCacheStorageDirectory = R"SWRESOURCE( 1353 1434 <script> … … 1379 1460 [WKWebsiteDataStore _allowWebsiteDataRecordsForAllOrigins]; 1380 1461 1381 RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 1382 1383 configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 1462 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 1384 1463 setConfigurationInjectedBundlePath(configuration.get()); 1385 1464
Note: See TracChangeset
for help on using the changeset viewer.