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

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

Issue 11641005: Add cross-origin test with credentials. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 simple unit test library for running tests in a browser. 6 * A simple unit test library for running tests in a browser.
7 */ 7 */
8 library unittest_html_config; 8 library unittest_html_config;
9 9
10 import 'dart:html'; 10 import 'dart:html';
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 void onDone(int passed, int failed, int errors, List<TestCase> results, 137 void onDone(int passed, int failed, int errors, List<TestCase> results,
138 String uncaughtError) { 138 String uncaughtError) {
139 _uninstallHandlers(); 139 _uninstallHandlers();
140 _showResultsInPage(passed, failed, errors, results, _isLayoutTest, 140 _showResultsInPage(passed, failed, errors, results, _isLayoutTest,
141 uncaughtError); 141 uncaughtError);
142 window.postMessage('unittest-suite-done', '*'); 142 window.postMessage('unittest-suite-done', '*');
143 } 143 }
144 } 144 }
145 145
146 /**
147 * Examine the url for this test to determine what the cross-origin port is for
148 * this test.
Siggi Cherem (dart-lang) 2013/01/04 01:49:43 nit: rephase, maybe "The value of the 'crossOrigin
Emily Fortuna 2013/01/04 23:26:54 Done.
149 */
150 int getCrossOriginPortNumber() {
Siggi Cherem (dart-lang) 2013/01/04 01:49:43 I think this should not be in unittest. I mean, it
Emily Fortuna 2013/01/04 23:26:54 Good point. Removed.
151 var searchUrl = window.location.search;
152 var crossOriginStr = 'crossOriginPort=';
153 var index = searchUrl.indexOf(crossOriginStr);
154 var nextArg = searchUrl.indexOf('&', index);
155 return int.parse(searchUrl.substring(index + crossOriginStr.length,
156 nextArg == -1 ? searchUrl.length : nextArg));
157 }
158
146 void useHtmlConfiguration([bool isLayoutTest = false]) { 159 void useHtmlConfiguration([bool isLayoutTest = false]) {
147 configure(new HtmlConfiguration(isLayoutTest)); 160 configure(new HtmlConfiguration(isLayoutTest));
148 } 161 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698