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

Unified Diff: security/cross-frame-access.html

Issue 12221052: Remove use of deprecated test methods (asynctTest/callbackDone/expectThrows). Base URL: http://src.chromium.org/multivm/trunk/webkit/LayoutTests/dart/
Patch Set: Created 7 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dom/Workers.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: security/cross-frame-access.html
===================================================================
--- security/cross-frame-access.html (revision 1080)
+++ security/cross-frame-access.html (working copy)
@@ -15,8 +15,8 @@
final crossOriginIFrame = new Element.tag('iframe');
crossOriginIFrame.src = 'data:text/html, <p>test iframe</p>';
- asyncTest('WaitForFramesLoad', 2, () {
- frameLoaded(Event e) { callbackDone(); }
+ test('WaitForFramesLoad', () {
+ var frameLoaded = expectAsync1((Event e) { }, count:2);
sameOriginIFrame.onLoad.listen(frameLoaded);
document.body.nodes.add(sameOriginIFrame);
crossOriginIFrame.onLoad.listen(frameLoaded);
@@ -33,7 +33,7 @@
testHistory(crossOriginIFrame.contentWindow.history);
});
- asyncTest('Location', 2, () {
+ test('Location', () {
testLocation(sameOriginIFrame.contentWindow.location);
testLocation(crossOriginIFrame.contentWindow.location);
});
@@ -46,15 +46,16 @@
testWindow(WindowBase targetWindow) {
// Not allowed methods.
- expectThrow(() => targetWindow.alert('test'));
- expectThrow(() => targetWindow.onLoad.listen((Event e) {}));
- expectThrow(() => targetWindow.find('test', true, true, true, true, true, true));
+ expect(() => targetWindow.alert('test'), throws);
+ expect(() => targetWindow.onLoad.listen((Event e) {}), throws);
+ expect(() =>
+ targetWindow.find('test', true, true, true, true, true, true), throws);
// Not allowed properties.
- expectThrow(() => targetWindow.contentDocument);
- expectThrow(() => targetWindow.frameElement);
- expectThrow(() => targetWindow.localStorage);
- expectThrow(() => targetWindow.console);
+ expect(() => targetWindow.contentDocument, throws);
+ expect(() => targetWindow.frameElement, throws);
+ expect(() => targetWindow.localStorage, throws);
+ expect(() => targetWindow.console, throws);
// Allowed methods.
targetWindow.close();
@@ -67,13 +68,13 @@
testHistory(HistoryBase history) {
// Not allowed properties.
- expectThrow(() => history.length);
+ expect(() => history.length, throws);
// Not allowed methods.
window.history.pushState('test', 'test', 'test');
- expectThrow(() => history.pushState('test', 'test', 'test'));
+ expect(() => history.pushState('test', 'test', 'test'), throws);
window.history.replaceState('test', 'test', 'test');
- expectThrow(() => history.replaceState('test', 'test', 'test'));
+ expect(() => history.replaceState('test', 'test', 'test'), throws);
// Allowed method.
history.back();
@@ -83,27 +84,27 @@
testLocation(LocationBase location) {
// Not allowed properties.
- expectThrow(() => location.href);
- expectThrow(() => location.protocol);
- expectThrow(() => location.host = 'test');
- expectThrow(() => location.origin);
+ expect(() => location.href, throws);
+ expect(() => location.protocol, throws);
+ expect(() => location.host = 'test', throws);
+ expect(() => location.origin, throws);
// Not allowed methods.
- expectThrow(() => location.assign('http://www.webkit.org'));
- expectThrow(() => location.reload());
- expectThrow(() => location.getParameter('test'));
+ expect(() => location.assign('http://www.webkit.org'), throws);
+ expect(() => location.reload(), throws);
+ expect(() => location.getParameter('test'), throws);
// Allowed properties.
- window.onMessage.listen((Event e) {
+ window.onMessage.listen(expectAsync1((Event e) {
expect(e.data, equals('navigated'));
- window.setTimeout(callbackDone, 0);
- });
+ window.setTimeout(expectAsync0((){}), 0);
+ }));
location.href = 'data:text/html, <script>parent.postMessage("navigated", "*")<${"/script>"}';
}
testIFrameElement(IFrameElement iframe) {
- expectThrow(() => iframe.contentDocument);
- expectThrow(() => iframe.getSVGDocument());
+ expect(() => iframe.contentDocument, throws);
+ expect(() => iframe.getSVGDocument(), throws);
}
</script>
« no previous file with comments | « dom/Workers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698