| OLD | NEW |
| 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 library browser; | 4 library browser; |
| 5 | 5 |
| 6 import "dart:async"; | 6 import "dart:async"; |
| 7 import "dart:convert" show LineSplitter, UTF8, JSON; | 7 import "dart:convert" show LineSplitter, UTF8, JSON; |
| 8 import "dart:core"; | 8 import "dart:core"; |
| 9 import "dart:io"; | 9 import "dart:io"; |
| 10 | 10 |
| (...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 if (testQueue.isEmpty) return null; | 1148 if (testQueue.isEmpty) return null; |
| 1149 | 1149 |
| 1150 // We are currently terminating this browser, don't start a new test. | 1150 // We are currently terminating this browser, don't start a new test. |
| 1151 if (status.timeout) return null; | 1151 if (status.timeout) return null; |
| 1152 | 1152 |
| 1153 // Restart content_shell and dartium on Android if they have been | 1153 // Restart content_shell and dartium on Android if they have been |
| 1154 // running for longer than RESTART_BROWSER_INTERVAL. The tests have | 1154 // running for longer than RESTART_BROWSER_INTERVAL. The tests have |
| 1155 // had flaky timeouts, and this may help. | 1155 // had flaky timeouts, and this may help. |
| 1156 if ((browserName == 'ContentShellOnAndroid' || | 1156 if ((browserName == 'ContentShellOnAndroid' || |
| 1157 browserName == 'DartiumOnAndroid' || | 1157 browserName == 'DartiumOnAndroid' || |
| 1158 browserName == 'ie10') && | 1158 browserName == 'ie10' || |
| 1159 browserName == 'ie11') && |
| 1159 status.timeSinceRestart.elapsed > RESTART_BROWSER_INTERVAL) { | 1160 status.timeSinceRestart.elapsed > RESTART_BROWSER_INTERVAL) { |
| 1160 var id = status.browser.id; | 1161 var id = status.browser.id; |
| 1161 // Reset stopwatch so we don't trigger again before restarting. | 1162 // Reset stopwatch so we don't trigger again before restarting. |
| 1162 status.timeout = true; | 1163 status.timeout = true; |
| 1163 status.browser.close().then((_) { | 1164 status.browser.close().then((_) { |
| 1164 // We don't want to start a new browser if we are terminating. | 1165 // We don't want to start a new browser if we are terminating. |
| 1165 if (underTermination) return; | 1166 if (underTermination) return; |
| 1166 restartBrowser(id); | 1167 restartBrowser(id); |
| 1167 }); | 1168 }); |
| 1168 // Don't send a test to the browser we are restarting. | 1169 // Don't send a test to the browser we are restarting. |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1793 </div> | 1794 </div> |
| 1794 <div id="embedded_iframe_div" class="test box"> | 1795 <div id="embedded_iframe_div" class="test box"> |
| 1795 <iframe style="width:100%;height:100%;" id="embedded_iframe"></iframe> | 1796 <iframe style="width:100%;height:100%;" id="embedded_iframe"></iframe> |
| 1796 </div> | 1797 </div> |
| 1797 </body> | 1798 </body> |
| 1798 </html> | 1799 </html> |
| 1799 """; | 1800 """; |
| 1800 return driverContent; | 1801 return driverContent; |
| 1801 } | 1802 } |
| 1802 } | 1803 } |
| OLD | NEW |