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

Unified Diff: dart/site/try/src/interaction_manager.dart

Issue 355953004: Change end_to_end_test so it doesn't time out due to V8 bug. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 | dart/tests/try/end_to_end_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/site/try/src/interaction_manager.dart
diff --git a/dart/site/try/src/interaction_manager.dart b/dart/site/try/src/interaction_manager.dart
index dba6d5547423d4dea912623aea08ed0853c566a6..6d3aaeba8faefd1a13dd0c3804bda98bcc4e5e03 100644
--- a/dart/site/try/src/interaction_manager.dart
+++ b/dart/site/try/src/interaction_manager.dart
@@ -174,6 +174,12 @@ abstract class InteractionManager {
void onIframeError(ErrorMessage message);
void verboseCompilerMessage(String message);
+
+ /// Called if the compiler crashes.
+ void onCompilerCrash(data);
+
+ /// Called if an internal error is detected.
+ void onInternalError(message);
}
/**
@@ -239,17 +245,8 @@ class InteractionContext extends InteractionManager {
} catch (error, stackTrace) {
try {
editor.isMalformedInput = true;
- outputDiv
- ..nodes.clear()
- ..append(new HeadingElement.h1()..appendText('Internal Error'))
- ..appendText('We would appreciate if you take a moment to report '
- 'this at ')
- ..append(
- new AnchorElement(href: TRY_DART_NEW_DEFECT)
- ..target = '_blank'
- ..appendText(TRY_DART_NEW_DEFECT))
- ..appendText('\nError and stack trace:\n$error\n')
- ..appendText('$stackTrace\n');
+ state.onInternalError(
+ '\nError and stack trace:\n$error\n$stackTrace\n');
} catch (e) {
// Double faults ignored.
}
@@ -292,6 +289,10 @@ class InteractionContext extends InteractionManager {
void verboseCompilerMessage(String message) {
return state.verboseCompilerMessage(message);
}
+
+ void onCompilerCrash(data) => state.onCompilerCrash(data);
+
+ void onInternalError(message) => state.onInternalError(message);
}
abstract class InteractionState implements InteractionManager {
@@ -743,6 +744,30 @@ class InitialState extends InteractionState {
}
}
}
+
+ void onCompilerCrash(data) {
+ onInternalError('Error and stack trace:\n$data');
+ }
+
+ void onInternalError(message) {
+ outputDiv
+ ..nodes.clear()
+ ..append(new HeadingElement.h1()..appendText('Internal Error'))
+ ..appendText('We would appreciate if you take a moment to report '
+ 'this at ')
+ ..append(
+ new AnchorElement(href: TRY_DART_NEW_DEFECT)
+ ..target = '_blank'
+ ..appendText(TRY_DART_NEW_DEFECT))
+ ..appendText('$message');
+ if (window.parent != window) {
+ // Test support.
+ // TODO(ahe): Use '/' instead of '*' when Firefox is upgraded to version
+ // 30 across build bots. Support for '/' was added in version 29, and we
+ // support the two most recent versions.
+ window.parent.postMessage('$message\n', '*');
+ }
+ }
}
Future<String> getString(uri) {
« no previous file with comments | « no previous file | dart/tests/try/end_to_end_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698