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

Issue 9453004: Cross frame access tests (Closed)

Created:
8 years, 10 months ago by vsm
Modified:
8 years, 10 months ago
Reviewers:
antonm, podivilov, sra, sra1
CC:
reviews_dartlang.org, antonm, sra
Visibility:
Public.

Description

Cross frame access tests We're allowing illegal cross-frame access on both Dartium and Frog right now. I'm working on fixing the latter. If these tests look good, I'll set the status file accordingly and land. Committed: https://code.google.com/p/dart/source/detail?r=4591

Patch Set 1 #

Total comments: 3

Patch Set 2 : Frog DOM support for safe cross-frame window access. #

Total comments: 18

Patch Set 3 : Final pass of comments, update of status #

Unified diffs Side-by-side diffs Delta from patch set Stats (+295 lines, -24 lines) Patch
M client/dom/frog/dom_frog.dart View 1 2 5 chunks +67 lines, -8 lines 0 comments Download
M client/dom/generated/src/frog/DOMWindow.dart View 1 1 chunk +0 lines, -2 lines 0 comments Download
M client/dom/generated/src/frog/HTMLIFrameElement.dart View 1 2 2 chunks +65 lines, -4 lines 0 comments Download
M client/dom/generated/src/frog/IDBDatabase.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M client/dom/generated/src/interface/IDBDatabase.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M client/dom/generated/src/wrapping/_IDBDatabaseWrappingImplementation.dart View 1 2 1 chunk +3 lines, -8 lines 0 comments Download
M client/dom/scripts/systemfrog.py View 1 2 2 chunks +21 lines, -0 lines 0 comments Download
A client/dom/templates/dom/frog/impl_HTMLIFrameElement.darttemplate View 1 2 1 chunk +68 lines, -0 lines 0 comments Download
M client/tests/client/client.status View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
A client/tests/client/dom/CrossFrameTest.dart View 1 2 1 chunk +27 lines, -0 lines 0 comments Download
A client/tests/client/dom/InnerFrameTest.dart View 1 2 1 chunk +40 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
vsm
https://chromiumcodereview.appspot.com/9453004/diff/1/client/tests/client/dom/CrossFrameTest.dart File client/tests/client/dom/CrossFrameTest.dart (right): https://chromiumcodereview.appspot.com/9453004/diff/1/client/tests/client/dom/CrossFrameTest.dart#newcode8 client/tests/client/dom/CrossFrameTest.dart:8: test('contentWindow', () { Passes on Dartium, fails with Frog. ...
8 years, 10 months ago (2012-02-23 06:00:38 UTC) #1
vsm
Stephen, I added Frog code to return a wrapped window. This gets tests passing. There's ...
8 years, 10 months ago (2012-02-24 03:00:34 UTC) #2
sra1
LGTM modulo comments. https://chromiumcodereview.appspot.com/9453004/diff/5001/client/dom/frog/dom_frog.dart File client/dom/frog/dom_frog.dart (right): https://chromiumcodereview.appspot.com/9453004/diff/5001/client/dom/frog/dom_frog.dart#newcode3007 client/dom/frog/dom_frog.dart:3007: Window get _contentWindow() native """ For ...
8 years, 10 months ago (2012-02-24 03:38:30 UTC) #3
antonm
Which of the tests fails on Dartium? https://chromiumcodereview.appspot.com/9453004/diff/5001/client/tests/client/dom/InnerFrameTest.dart File client/tests/client/dom/InnerFrameTest.dart (right): https://chromiumcodereview.appspot.com/9453004/diff/5001/client/tests/client/dom/InnerFrameTest.dart#newcode6 client/tests/client/dom/InnerFrameTest.dart:6: if (window ...
8 years, 10 months ago (2012-02-24 09:28:54 UTC) #4
podivilov
lgtm
8 years, 10 months ago (2012-02-24 12:18:58 UTC) #5
antonm
Thanks a lot for clarifications, Vijay https://chromiumcodereview.appspot.com/9453004/diff/5001/client/tests/client/dom/CrossFrameTest.dart File client/tests/client/dom/CrossFrameTest.dart (right): https://chromiumcodereview.appspot.com/9453004/diff/5001/client/tests/client/dom/CrossFrameTest.dart#newcode26 client/tests/client/dom/CrossFrameTest.dart:26: }); nit: -2 ...
8 years, 10 months ago (2012-02-24 15:31:23 UTC) #6
vsm
8 years, 10 months ago (2012-02-26 01:52:10 UTC) #7
Thanks, landed.

Opened http://code.google.com/p/dart/issues/detail?id=1858 for Dartium bugs.

https://chromiumcodereview.appspot.com/9453004/diff/5001/client/dom/frog/dom_...
File client/dom/frog/dom_frog.dart (right):

https://chromiumcodereview.appspot.com/9453004/diff/5001/client/dom/frog/dom_...
client/dom/frog/dom_frog.dart:3007: Window get _contentWindow() native """
On 2012/02/24 03:38:30, sra1 wrote:
> For short ones that fit on the same line I just go with 'return xxx;';

Done.

https://chromiumcodereview.appspot.com/9453004/diff/5001/client/dom/frog/dom_...
client/dom/frog/dom_frog.dart:3017: // TODO(vsm): Unify with Dartium version.
File added.

On 2012/02/24 03:38:30, sra1 wrote:
> The file(s) containing this function is missing from the CL, so I'm making
> comments here.

https://chromiumcodereview.appspot.com/9453004/diff/5001/client/dom/frog/dom_...
client/dom/frog/dom_frog.dart:3018: class _DOMWindowCrossFrameJs implements
DOMType, DOMWindow {
On 2012/02/24 03:38:30, sra1 wrote:
> Drop the 'Js'.  That is for native classes.

Done.

https://chromiumcodereview.appspot.com/9453004/diff/5001/client/dom/frog/dom_...
client/dom/frog/dom_frog.dart:3039: var get document() { throw new Exception();
}
I'm going to remove this and mark as a bug.

On 2012/02/24 03:38:30, sra1 wrote:
> This is weird.
> I wonder if it is related to the top level definition of get:document.

https://chromiumcodereview.appspot.com/9453004/diff/5001/client/dom/frog/dom_...
client/dom/frog/dom_frog.dart:3054: void postMessage(Dynamic message, String
targetOrigin, [List messagePorts = null]) {
On 2012/02/24 03:38:30, sra1 wrote:
> Line length

Done.

https://chromiumcodereview.appspot.com/9453004/diff/5001/client/dom/scripts/s...
File client/dom/scripts/systemfrog.py (right):

https://chromiumcodereview.appspot.com/9453004/diff/5001/client/dom/scripts/s...
client/dom/scripts/systemfrog.py:15: _overridden_members = set([
On 2012/02/24 03:38:30, sra1 wrote:
> Call this _dom_frog_omitted_members.
> With everyone currently doing import * the names need to be generator
specific.

Done, though we should consider making some of this general.

https://chromiumcodereview.appspot.com/9453004/diff/5001/client/tests/client/...
File client/tests/client/dom/CrossFrameTest.dart (right):

https://chromiumcodereview.appspot.com/9453004/diff/5001/client/tests/client/...
client/tests/client/dom/CrossFrameTest.dart:13: // Test this field to ensure a
valid Dart wrapper.
On 2012/02/24 03:38:30, sra1 wrote:
> Since all native classes implement this, it is not distinguishing between the
> wrapper and a native object.
> Since dartObjectLocalStorages is unused unless the wrapping dart:html library
> has wrapped it, it will always be null.
> I want to get rid of dartObjectLocalStorage if possible after the direct
> dart:html lands.
> 
> Is there something else you can test?
> 
> If the issue is lack of access to private methods, I think it is OK for
dart:dom
> to export a public testing class like this:
> 
> class DOMTesting {
>   bool static isDOMWindowCrossFrame(object) => object is
__DOMWindowCrossFrame;
> }
> 
> Longer term the language needs to make it possible for tests to be in library
/
> package / whatever.

This is effectively verifying that the object belongs to this frame - i.e., it
inherits from this frame's Object proto.

Without window wrapper, this check failed as the window object was not decorated
with a dartObjectLocalStorage getter.

https://chromiumcodereview.appspot.com/9453004/diff/5001/client/tests/client/...
client/tests/client/dom/CrossFrameTest.dart:26: });
On 2012/02/24 15:31:24, antonm wrote:
> nit: -2 spaces, please

Done.

Powered by Google App Engine
This is Rietveld 408576698