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

Side by Side Diff: pkg/unittest/lib/html_layout_config.dart

Issue 12770017: pkg/unittest: config refactor (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: per siggi's recomendations Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * A configuration for running layout tests with testrunner. 6 * A configuration for running layout tests with testrunner.
7 * This configuration is similar to the interactive_html_config 7 * This configuration is similar to the interactive_html_config
8 * as it runs each test in its own IFrame. However, where the former 8 * as it runs each test in its own IFrame. However, where the former
9 * recreated the IFrame for each test, here the IFrames are preserved. 9 * recreated the IFrame for each test, here the IFrames are preserved.
10 * Furthermore we post a message on completion. 10 * Furthermore we post a message on completion.
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 if (document.query('#child') == null) { 299 if (document.query('#child') == null) {
300 document.body.nodes.add(new Element.html("<div id='child'></div>")); 300 document.body.nodes.add(new Element.html("<div id='child'></div>"));
301 } 301 }
302 } 302 }
303 303
304 /** 304 /**
305 * Allocate a Configuration. We allocate either a parent or 305 * Allocate a Configuration. We allocate either a parent or
306 * child, depending on whether the URL has a search part. 306 * child, depending on whether the URL has a search part.
307 */ 307 */
308 void useHtmlLayoutConfiguration() { 308 void useHtmlLayoutConfiguration() {
309 if (config != null) return;
310 if (window.location.search == '') { // This is the parent. 309 if (window.location.search == '') { // This is the parent.
311 _prepareDom(); 310 _prepareDom();
312 configure(new ParentHtmlConfiguration()); 311 config = _singletonParent;
313 } else { 312 } else {
314 configure(new ChildHtmlConfiguration()); 313 config = _singletonChild;
315 } 314 }
316 } 315 }
317 316
317 final _singletonParent = new ParentHtmlConfiguration();
318 final _singletonChild = new ChildHtmlConfiguration();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698