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

Unified Diff: tools/testing/dart/browser_controller.dart

Issue 15199003: Fix driver page for browser controller to not double fetch tests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/browser_controller.dart
===================================================================
--- tools/testing/dart/browser_controller.dart (revision 22724)
+++ tools/testing/dart/browser_controller.dart (working copy)
@@ -491,7 +491,7 @@
Browser getInstance() {
if (browserName == "chrome") {
return new Chrome();
- } else if (browserName == "firefox") {
+ } else if (browserName == "ff") {
return new Firefox();
}
throw "Non supported browser for browser controller";
@@ -610,9 +610,10 @@
<head>
<title>Driving page</title>
<script type='text/javascript'>
- var numberOfTests = 0;
- var currentId;
+ var number_of_tests = 0;
+ var current_id;
var testing_window;
+ var last_reported_id;
function newTaskHandler() {
if (this.readyState == this.DONE) {
@@ -628,7 +629,7 @@
// URL#ID
var split = this.responseText.split('#');
var nextTask = split[0];
- id = split[1];
+ current_id = split[1];
run(nextTask);
}
} else {
@@ -645,8 +646,8 @@
}
function run(url) {
- numberOfTests++;
- document.getElementById('number').innerHTML = numberOfTests;
+ number_of_tests++;
+ document.getElementById('number').innerHTML = number_of_tests;
if (testing_window == undefined) {
testing_window = window.open(url);
} else {
@@ -658,11 +659,14 @@
var client = new XMLHttpRequest();
function handleReady() {
if (this.readyState == this.DONE) {
- getNextTask();
+ if (current_id != last_reported_id) {
+ getNextTask();
+ last_reported_id = current_id;
+ }
}
}
client.onreadystatechange = handleReady;
- client.open('POST', '$reportPath/${browserId}?id=' + id);
+ client.open('POST', '$reportPath/${browserId}?id=' + current_id);
client.setRequestHeader('Content-type',
'application/x-www-form-urlencoded');
client.send(msg);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698