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

Unified Diff: pkg/analysis_server/test/stress/replay/operation.dart

Issue 1471443002: Initial work toward a stress test (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | pkg/analysis_server/test/stress/replay/replay.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/stress/replay/operation.dart
diff --git a/pkg/analysis_server/test/stress/replay/operation.dart b/pkg/analysis_server/test/stress/replay/operation.dart
new file mode 100644
index 0000000000000000000000000000000000000000..bd28a0c212784e82949c2b7a282ebcebc52c0c2d
--- /dev/null
+++ b/pkg/analysis_server/test/stress/replay/operation.dart
@@ -0,0 +1,57 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * Operations to be performed during the simulation.
+ */
+library analysis_server.test.stress.replay.replay;
scheglov 2015/11/20 22:52:18 library analysis_server.test.stress.replay.operati
+
+import '../utilities/server.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
scheglov 2015/11/20 22:52:18 Sort?
+
+/**
+ * An operation to be performed during the simulation.
+ */
+abstract class ServerOperation {
+ /**
+ * Perform this operation by communicating with the given [server].
+ */
+ void perform(Server server);
+}
+
+/**
+ * An operation that will send an 'analysis.updateContent' request.
+ */
+class AnalysisUpdateContent extends ServerOperation {
+ /**
+ * The path of the file whose content is being updated.
+ */
+ String filePath;
+
+ /**
+ * The overlay used to update the content.
+ */
+ dynamic overlay;
+
+ /**
+ * Initialize an operation to send an 'analysis.updateContent' request with
+ * the given [filePath] and [overlay] as parameters.
+ */
+ AnalysisUpdateContent(this.filePath, this.overlay);
+
+ @override
+ void perform(Server server) {
+ server.sendAnalysisUpdateContent({filePath: overlay});
+// if (overlay is ChangeContentOverlay) {
+// List<SourceEdit> edits = (overlay as ChangeContentOverlay).edits;
+// if (edits.length == 1) {
+// SourceEdit edit = edits[0];
+// if (edit.replacement.endsWith('.')) {
+// int offset = edit.offset + edit.replacement.length - 1;
+// server.sendCompletionGetSuggestions(filePath, offset);
+// }
+// }
+// }
+ }
+}
« no previous file with comments | « no previous file | pkg/analysis_server/test/stress/replay/replay.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698