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

Unified Diff: runtime/vm/report_test.cc

Issue 1690903003: Remove support for Javascript warnings in the VM. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « runtime/vm/report.cc ('k') | runtime/vm/stub_code_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/report_test.cc
diff --git a/runtime/vm/report_test.cc b/runtime/vm/report_test.cc
deleted file mode 100644
index d939dd2353fe002cd3b540067aba949efabbaefe..0000000000000000000000000000000000000000
--- a/runtime/vm/report_test.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2014, 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.
-
-#include "platform/assert.h"
-#include "vm/report.h"
-#include "vm/unit_test.h"
-
-namespace dart {
-
-#ifndef PRODUCT
-
-TEST_CASE(TraceJSWarning) {
- Zone* zone = thread->zone();
- Isolate* isolate = thread->isolate();
- TraceBuffer::Init(isolate, 3);
- TraceBuffer* trace_buffer = isolate->trace_buffer();
- const String& url = String::Handle(zone, String::New("Plug"));
- const String& source = String::Handle(zone, String::New("240 100"));
- const Script& script = Script::Handle(zone,
- Script::New(url, source, RawScript::kEvaluateTag));
- script.Tokenize(String::Handle(String::New("")));
- {
- const TokenPosition token_pos = TokenPosition(0);
- const char* message = "High Voltage";
- Report::MessageF(Report::kJSWarning,
- script, token_pos, Report::AtLocation, "%s", message);
- {
- JSONStream js;
- trace_buffer->PrintToJSONStream(&js);
- EXPECT_SUBSTRING("{\"type\":\"TraceBuffer\",\"members\":["
- "{\"type\":\"TraceBufferEntry\",\"time\":",
- js.ToCString());
- // Skip time.
- EXPECT_SUBSTRING("\"message\":{\"type\":\"JSCompatibilityWarning\","
- "\"script\":{\"type\":\"@Script\"",
- js.ToCString());
- // Skip object ring id.
- EXPECT_SUBSTRING("\"uri\":\"Plug\","
- "\"_kind\":\"evaluate\"},\"tokenPos\":0,"
- "\"message\":{\"type\":\"@Instance\"",
- js.ToCString());
- // Skip private _OneByteString.
- EXPECT_SUBSTRING("\"valueAsString\":\"High Voltage\"",
- js.ToCString());
- }
- }
- {
- const TokenPosition token_pos = TokenPosition(1);
- const char* message = "Low Voltage";
- Report::MessageF(Report::kJSWarning,
- script, token_pos, Report::AtLocation, "%s", message);
- }
- EXPECT_EQ(2, trace_buffer->Length());
- EXPECT_SUBSTRING("{\"type\":\"JSCompatibilityWarning\",\"script\":{\"type\":"
- "\"@Script\"",
- trace_buffer->At(0)->message);
- // Skip object ring id.
- EXPECT_SUBSTRING("\"uri\":\"Plug\","
- "\"_kind\":\"evaluate\"},\"tokenPos\":0,"
- "\"message\":{\"type\":\"@Instance\"",
- trace_buffer->At(0)->message);
- // Skip private _OneByteString.
- EXPECT_SUBSTRING("\"valueAsString\":\"High Voltage\"",
- trace_buffer->At(0)->message);
-
- EXPECT_SUBSTRING("{\"type\":\"JSCompatibilityWarning\",\"script\":{\"type\":"
- "\"@Script\"",
- trace_buffer->At(1)->message);
- // Skip object ring id.
- EXPECT_SUBSTRING("\"uri\":\"Plug\","
- "\"_kind\":\"evaluate\"},\"tokenPos\":1,"
- "\"message\":{\"type\":\"@Instance\"",
- trace_buffer->At(1)->message);
- // Skip private _OneByteString.
- EXPECT_SUBSTRING("\"valueAsString\":\"Low Voltage\"",
- trace_buffer->At(1)->message);
-
- delete trace_buffer;
-}
-
-#endif // !PRODUCT
-
-} // namespace dart
« no previous file with comments | « runtime/vm/report.cc ('k') | runtime/vm/stub_code_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698