Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for 'cross-origin-isolated' permission #24600

Merged
merged 9 commits into from
Aug 18, 2020

Conversation

yutakahirano
Copy link
Contributor

Make sure self.crossOriginIsolated is affected by the permission.

@yutakahirano
Copy link
Contributor Author

These are tests for whatwg/html#5435. @domenic @annevk what do you think about them?

@wpt-pr-bot wpt-pr-bot had a problem deploying to wpt-preview-24600 July 15, 2020 10:35 Error
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nit.

At some point you'll want tests similar to those in https://github.com/web-platform-tests/wpt/tree/master/origin-isolation to test whether crossOriginIsolated actually prevents WebAssembly.Module sharing and document.domain setting, but that can be done separately.

@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24600 July 17, 2020 05:39 Inactive
@annevk
Copy link
Member

annevk commented Jul 17, 2020

No existing tests are impacted by this change? I would have expected we'd have at least one test where we assert self.crossOriginIsolated in a different origin.

@yutakahirano
Copy link
Contributor Author

Currently I see 5 tests. https://github.com/web-platform-tests/wpt/search?q=crossOriginIsolated&unscoped_q=crossOriginIsolated

None seems related to cross-origin nested frame.

@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24600 July 17, 2020 12:16 Inactive
@annevk
Copy link
Member

annevk commented Jul 17, 2020

It seems like html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html should be impacted, right?

That would mean however that you cannot use data URL workers and shared memory. At least not until there is Permissions Policy for workers.

@yutakahirano
Copy link
Contributor Author

It seems like html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html should be impacted, right?

That's true, thanks!

That would mean however that you cannot use data URL workers and shared memory. At least not until there is Permissions Policy for workers.

If the use-case is very important we could circumvent that.

@annevk
Copy link
Member

annevk commented Jul 20, 2020

I don't think it's important enough to add exceptions for.

@wpt-pr-bot wpt-pr-bot requested a deployment to wpt-preview-24600 July 21, 2020 09:48 Pending
@yutakahirano
Copy link
Contributor Author

Fixed html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.

Make sure self.crossOriginIsolated is affected by the permission.
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24600 August 17, 2020 04:39 Inactive
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24600 August 17, 2020 04:48 Inactive
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24600 August 17, 2020 05:41 Inactive
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24600 August 17, 2020 05:58 Inactive
@yutakahirano
Copy link
Contributor Author

html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html is flaky and that prevents me from landing this. I suspect that the flakiness is not related to this change, and I reverted the change to the file.

@domenic
Copy link
Member

domenic commented Aug 17, 2020

Still LGTM, feel free to merge at will. But we should update html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html separately. Perhaps that will happen as part of your implementation work.

@yutakahirano yutakahirano merged commit 50255e6 into master Aug 18, 2020
@yutakahirano yutakahirano deleted the yhirano/cross-origin-isolated-permissions branch August 18, 2020 14:40
}

generateTest(ORIGIN, undefined, true);
generateTest(ORIGIN, '*', true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this test is using the Permissions-Policy header, it should use the structured syntax for that --
The * case looks correct, but self should be unquoted, as it's a SF-token, and "none" should be () (empty list)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I will fix them.

chromium-wpt-export-bot pushed a commit that referenced this pull request Sep 24, 2020
 - Fix WindowOrWorketGlobalScope.crossOriginIsolated behavior for
   workers.
   - For SharedWorkers and ServiceWorkers it always return false. See
     https://crbug.com/1131403 and https://crbug.com/1131404.
 - Rename ExecutionContext::IsCrossOriginIsolated to
   CrossOriginCapability. This is aligned with
   https://html.spec.whatwg.org/C/#concept-settings-object-cross-origin-isolated-capability.
 - Fix wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.
   I originally planned to do that in
   #24600 but I couldn't
   do that due to some flakiness.
 - Add more tests for workers in
   wpt/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html.

Bug: 1115379, 1018680, 1131403, 1131404
Change-Id: I2afcb01403f67a11fd06aefde1238aba16b68f36
chromium-wpt-export-bot pushed a commit that referenced this pull request Sep 24, 2020
 - Fix WindowOrWorketGlobalScope.crossOriginIsolated behavior for
   workers.
   - For SharedWorkers and ServiceWorkers it always return false. See
     https://crbug.com/1131403 and https://crbug.com/1131404.
 - Rename ExecutionContext::IsCrossOriginIsolated to
   CrossOriginCapability. This is aligned with
   https://html.spec.whatwg.org/C/#concept-settings-object-cross-origin-isolated-capability.
 - Fix wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.
   I originally planned to do that in
   #24600 but I couldn't
   do that due to some flakiness.
 - Add more tests for workers in
   wpt/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html.

Bug: 1115379, 1018680, 1131403, 1131404
Change-Id: I2afcb01403f67a11fd06aefde1238aba16b68f36
chromium-wpt-export-bot pushed a commit that referenced this pull request Sep 24, 2020
 - Fix WindowOrWorketGlobalScope.crossOriginIsolated behavior for
   workers.
   - For SharedWorkers and ServiceWorkers it always return false. See
     https://crbug.com/1131403 and https://crbug.com/1131404.
 - Rename ExecutionContext::IsCrossOriginIsolated to
   CrossOriginCapability. This is aligned with
   https://html.spec.whatwg.org/C/#concept-settings-object-cross-origin-isolated-capability.
 - Fix wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.
   I originally planned to do that in
   #24600 but I couldn't
   do that due to some flakiness.
 - Add more tests for workers in
   wpt/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html.

Bug: 1115379, 1018680, 1131403, 1131404
Change-Id: I2afcb01403f67a11fd06aefde1238aba16b68f36
chromium-wpt-export-bot pushed a commit that referenced this pull request Sep 24, 2020
 - Fix WindowOrWorketGlobalScope.crossOriginIsolated behavior for
   workers.
   - For SharedWorkers and ServiceWorkers it always return false. See
     https://crbug.com/1131403 and https://crbug.com/1131404.
 - Rename ExecutionContext::IsCrossOriginIsolated to
   CrossOriginCapability. This is aligned with
   https://html.spec.whatwg.org/C/#concept-settings-object-cross-origin-isolated-capability.
 - Fix wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.
   I originally planned to do that in
   #24600 but I couldn't
   do that due to some flakiness.
 - Add more tests for workers in
   wpt/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html.

Bug: 1115379, 1018680, 1131403, 1131404
Change-Id: I2afcb01403f67a11fd06aefde1238aba16b68f36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416428
Commit-Queue: Yutaka Hirano <[email protected]>
Reviewed-by: Domenic Denicola <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
Reviewed-by: Hiroki Nakagawa <[email protected]>
Cr-Commit-Position: refs/heads/master@{#810130}
blueboxd pushed a commit to blueboxd/chromium-legacy that referenced this pull request Sep 24, 2020
 - Fix WindowOrWorketGlobalScope.crossOriginIsolated behavior for
   workers.
   - For SharedWorkers and ServiceWorkers it always return false. See
     https://crbug.com/1131403 and https://crbug.com/1131404.
 - Rename ExecutionContext::IsCrossOriginIsolated to
   CrossOriginCapability. This is aligned with
   https://html.spec.whatwg.org/C/#concept-settings-object-cross-origin-isolated-capability.
 - Fix wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.
   I originally planned to do that in
   web-platform-tests/wpt#24600 but I couldn't
   do that due to some flakiness.
 - Add more tests for workers in
   wpt/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html.

Bug: 1115379, 1018680, 1131403, 1131404
Change-Id: I2afcb01403f67a11fd06aefde1238aba16b68f36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416428
Commit-Queue: Yutaka Hirano <[email protected]>
Reviewed-by: Domenic Denicola <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
Reviewed-by: Hiroki Nakagawa <[email protected]>
Cr-Commit-Position: refs/heads/master@{#810130}
stephenmcgruer pushed a commit that referenced this pull request Sep 24, 2020
- Fix WindowOrWorketGlobalScope.crossOriginIsolated behavior for
   workers.
   - For SharedWorkers and ServiceWorkers it always return false. See
     https://crbug.com/1131403 and https://crbug.com/1131404.
 - Rename ExecutionContext::IsCrossOriginIsolated to
   CrossOriginCapability. This is aligned with
   https://html.spec.whatwg.org/C/#concept-settings-object-cross-origin-isolated-capability.
 - Fix wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.
   I originally planned to do that in
   #24600 but I couldn't
   do that due to some flakiness.
 - Add more tests for workers in
   wpt/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html.

Bug: 1115379, 1018680, 1131403, 1131404
Change-Id: I2afcb01403f67a11fd06aefde1238aba16b68f36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416428
Commit-Queue: Yutaka Hirano <[email protected]>
Reviewed-by: Domenic Denicola <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
Reviewed-by: Hiroki Nakagawa <[email protected]>
Cr-Commit-Position: refs/heads/master@{#810130}

Co-authored-by: Yutaka Hirano <[email protected]>
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Sep 26, 2020
…n for workers, a=testonly

Automatic update from web-platform-tests
Refine crossOriginIsolated implementation for workers (#25748)

- Fix WindowOrWorketGlobalScope.crossOriginIsolated behavior for
   workers.
   - For SharedWorkers and ServiceWorkers it always return false. See
     https://crbug.com/1131403 and https://crbug.com/1131404.
 - Rename ExecutionContext::IsCrossOriginIsolated to
   CrossOriginCapability. This is aligned with
   https://html.spec.whatwg.org/C/#concept-settings-object-cross-origin-isolated-capability.
 - Fix wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.
   I originally planned to do that in
   web-platform-tests/wpt#24600 but I couldn't
   do that due to some flakiness.
 - Add more tests for workers in
   wpt/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html.

Bug: 1115379, 1018680, 1131403, 1131404
Change-Id: I2afcb01403f67a11fd06aefde1238aba16b68f36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416428
Commit-Queue: Yutaka Hirano <[email protected]>
Reviewed-by: Domenic Denicola <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
Reviewed-by: Hiroki Nakagawa <[email protected]>
Cr-Commit-Position: refs/heads/master@{#810130}

Co-authored-by: Yutaka Hirano <[email protected]>
--

wpt-commits: ce281cc3f32d8e93ecbb33a51321d846ee2aae37
wpt-pr: 25748
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Sep 28, 2020
…n for workers, a=testonly

Automatic update from web-platform-tests
Refine crossOriginIsolated implementation for workers (#25748)

- Fix WindowOrWorketGlobalScope.crossOriginIsolated behavior for
   workers.
   - For SharedWorkers and ServiceWorkers it always return false. See
     https://crbug.com/1131403 and https://crbug.com/1131404.
 - Rename ExecutionContext::IsCrossOriginIsolated to
   CrossOriginCapability. This is aligned with
   https://html.spec.whatwg.org/C/#concept-settings-object-cross-origin-isolated-capability.
 - Fix wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.
   I originally planned to do that in
   web-platform-tests/wpt#24600 but I couldn't
   do that due to some flakiness.
 - Add more tests for workers in
   wpt/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html.

Bug: 1115379, 1018680, 1131403, 1131404
Change-Id: I2afcb01403f67a11fd06aefde1238aba16b68f36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416428
Commit-Queue: Yutaka Hirano <yhiranochromium.org>
Reviewed-by: Domenic Denicola <domenicchromium.org>
Reviewed-by: Robert Flack <flackrchromium.org>
Reviewed-by: Hiroki Nakagawa <nhirokichromium.org>
Cr-Commit-Position: refs/heads/master{#810130}

Co-authored-by: Yutaka Hirano <yhiranochromium.org>
--

wpt-commits: ce281cc3f32d8e93ecbb33a51321d846ee2aae37
wpt-pr: 25748

UltraBlame original commit: 5f56ebdc5770a063488415b229752f7094dc4811
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Sep 28, 2020
…n for workers, a=testonly

Automatic update from web-platform-tests
Refine crossOriginIsolated implementation for workers (#25748)

- Fix WindowOrWorketGlobalScope.crossOriginIsolated behavior for
   workers.
   - For SharedWorkers and ServiceWorkers it always return false. See
     https://crbug.com/1131403 and https://crbug.com/1131404.
 - Rename ExecutionContext::IsCrossOriginIsolated to
   CrossOriginCapability. This is aligned with
   https://html.spec.whatwg.org/C/#concept-settings-object-cross-origin-isolated-capability.
 - Fix wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.
   I originally planned to do that in
   web-platform-tests/wpt#24600 but I couldn't
   do that due to some flakiness.
 - Add more tests for workers in
   wpt/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html.

Bug: 1115379, 1018680, 1131403, 1131404
Change-Id: I2afcb01403f67a11fd06aefde1238aba16b68f36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416428
Commit-Queue: Yutaka Hirano <yhiranochromium.org>
Reviewed-by: Domenic Denicola <domenicchromium.org>
Reviewed-by: Robert Flack <flackrchromium.org>
Reviewed-by: Hiroki Nakagawa <nhirokichromium.org>
Cr-Commit-Position: refs/heads/master{#810130}

Co-authored-by: Yutaka Hirano <yhiranochromium.org>
--

wpt-commits: ce281cc3f32d8e93ecbb33a51321d846ee2aae37
wpt-pr: 25748

UltraBlame original commit: 5f56ebdc5770a063488415b229752f7094dc4811
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Sep 28, 2020
…n for workers, a=testonly

Automatic update from web-platform-tests
Refine crossOriginIsolated implementation for workers (#25748)

- Fix WindowOrWorketGlobalScope.crossOriginIsolated behavior for
   workers.
   - For SharedWorkers and ServiceWorkers it always return false. See
     https://crbug.com/1131403 and https://crbug.com/1131404.
 - Rename ExecutionContext::IsCrossOriginIsolated to
   CrossOriginCapability. This is aligned with
   https://html.spec.whatwg.org/C/#concept-settings-object-cross-origin-isolated-capability.
 - Fix wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.
   I originally planned to do that in
   web-platform-tests/wpt#24600 but I couldn't
   do that due to some flakiness.
 - Add more tests for workers in
   wpt/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html.

Bug: 1115379, 1018680, 1131403, 1131404
Change-Id: I2afcb01403f67a11fd06aefde1238aba16b68f36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416428
Commit-Queue: Yutaka Hirano <yhiranochromium.org>
Reviewed-by: Domenic Denicola <domenicchromium.org>
Reviewed-by: Robert Flack <flackrchromium.org>
Reviewed-by: Hiroki Nakagawa <nhirokichromium.org>
Cr-Commit-Position: refs/heads/master{#810130}

Co-authored-by: Yutaka Hirano <yhiranochromium.org>
--

wpt-commits: ce281cc3f32d8e93ecbb33a51321d846ee2aae37
wpt-pr: 25748

UltraBlame original commit: 5f56ebdc5770a063488415b229752f7094dc4811
sidvishnoi pushed a commit to sidvishnoi/gecko-webmonetization that referenced this pull request Oct 1, 2020
…n for workers, a=testonly

Automatic update from web-platform-tests
Refine crossOriginIsolated implementation for workers (#25748)

- Fix WindowOrWorketGlobalScope.crossOriginIsolated behavior for
   workers.
   - For SharedWorkers and ServiceWorkers it always return false. See
     https://crbug.com/1131403 and https://crbug.com/1131404.
 - Rename ExecutionContext::IsCrossOriginIsolated to
   CrossOriginCapability. This is aligned with
   https://html.spec.whatwg.org/C/#concept-settings-object-cross-origin-isolated-capability.
 - Fix wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.
   I originally planned to do that in
   web-platform-tests/wpt#24600 but I couldn't
   do that due to some flakiness.
 - Add more tests for workers in
   wpt/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html.

Bug: 1115379, 1018680, 1131403, 1131404
Change-Id: I2afcb01403f67a11fd06aefde1238aba16b68f36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416428
Commit-Queue: Yutaka Hirano <[email protected]>
Reviewed-by: Domenic Denicola <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
Reviewed-by: Hiroki Nakagawa <[email protected]>
Cr-Commit-Position: refs/heads/master@{#810130}

Co-authored-by: Yutaka Hirano <[email protected]>
--

wpt-commits: ce281cc3f32d8e93ecbb33a51321d846ee2aae37
wpt-pr: 25748
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this pull request Oct 14, 2022
 - Fix WindowOrWorketGlobalScope.crossOriginIsolated behavior for
   workers.
   - For SharedWorkers and ServiceWorkers it always return false. See
     https://crbug.com/1131403 and https://crbug.com/1131404.
 - Rename ExecutionContext::IsCrossOriginIsolated to
   CrossOriginCapability. This is aligned with
   https://html.spec.whatwg.org/C/#concept-settings-object-cross-origin-isolated-capability.
 - Fix wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.
   I originally planned to do that in
   web-platform-tests/wpt#24600 but I couldn't
   do that due to some flakiness.
 - Add more tests for workers in
   wpt/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html.

Bug: 1115379, 1018680, 1131403, 1131404
Change-Id: I2afcb01403f67a11fd06aefde1238aba16b68f36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416428
Commit-Queue: Yutaka Hirano <[email protected]>
Reviewed-by: Domenic Denicola <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
Reviewed-by: Hiroki Nakagawa <[email protected]>
Cr-Commit-Position: refs/heads/master@{#810130}
GitOrigin-RevId: b9cd56c1c97be3bb4f542f25789cacfa76051e42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants