OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 | 4 |
5 #include "platform/assert.h" | 5 #include "platform/assert.h" |
6 #include "vm/report.h" | 6 #include "vm/report.h" |
7 #include "vm/unit_test.h" | 7 #include "vm/unit_test.h" |
8 | 8 |
9 namespace dart { | 9 namespace dart { |
10 | 10 |
| 11 #ifndef PRODUCT |
| 12 |
11 TEST_CASE(TraceJSWarning) { | 13 TEST_CASE(TraceJSWarning) { |
12 Zone* zone = thread->zone(); | 14 Zone* zone = thread->zone(); |
13 Isolate* isolate = thread->isolate(); | 15 Isolate* isolate = thread->isolate(); |
14 TraceBuffer::Init(isolate, 3); | 16 TraceBuffer::Init(isolate, 3); |
15 TraceBuffer* trace_buffer = isolate->trace_buffer(); | 17 TraceBuffer* trace_buffer = isolate->trace_buffer(); |
16 const String& url = String::Handle(zone, String::New("Plug")); | 18 const String& url = String::Handle(zone, String::New("Plug")); |
17 const String& source = String::Handle(zone, String::New("240 100")); | 19 const String& source = String::Handle(zone, String::New("240 100")); |
18 const Script& script = Script::Handle(zone, | 20 const Script& script = Script::Handle(zone, |
19 Script::New(url, source, RawScript::kEvaluateTag)); | 21 Script::New(url, source, RawScript::kEvaluateTag)); |
20 script.Tokenize(String::Handle(String::New(""))); | 22 script.Tokenize(String::Handle(String::New(""))); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 "\"_kind\":\"evaluate\"},\"tokenPos\":1," | 72 "\"_kind\":\"evaluate\"},\"tokenPos\":1," |
71 "\"message\":{\"type\":\"@Instance\"", | 73 "\"message\":{\"type\":\"@Instance\"", |
72 trace_buffer->At(1)->message); | 74 trace_buffer->At(1)->message); |
73 // Skip private _OneByteString. | 75 // Skip private _OneByteString. |
74 EXPECT_SUBSTRING("\"valueAsString\":\"Low Voltage\"", | 76 EXPECT_SUBSTRING("\"valueAsString\":\"Low Voltage\"", |
75 trace_buffer->At(1)->message); | 77 trace_buffer->At(1)->message); |
76 | 78 |
77 delete trace_buffer; | 79 delete trace_buffer; |
78 } | 80 } |
79 | 81 |
| 82 #endif // !PRODUCT |
| 83 |
80 } // namespace dart | 84 } // namespace dart |
OLD | NEW |