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

Unified Diff: runtime/vm/benchmark_test.h

Issue 10868043: Move print to corelib. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make it pass all tests. Created 8 years, 4 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
Index: runtime/vm/benchmark_test.h
diff --git a/runtime/vm/benchmark_test.h b/runtime/vm/benchmark_test.h
index 4b27abdf0d8e6fef1edb322abbacf3dd6101f7f6..ec357d2c0dd08e6b790d740f88dbecd91ebea20d 100644
--- a/runtime/vm/benchmark_test.h
+++ b/runtime/vm/benchmark_test.h
@@ -12,6 +12,7 @@
#include "vm/heap.h"
#include "vm/isolate.h"
#include "vm/object.h"
+#include "vm/unit_test.h"
#include "vm/zone.h"
namespace dart {
@@ -93,6 +94,19 @@ class BenchmarkIsolateScope {
explicit BenchmarkIsolateScope(Benchmark* benchmark) : benchmark_(benchmark) {
benchmark_->CreateIsolate(NULL);
Dart_EnterScope(); // Create a Dart API scope for unit benchmarks.
+
+ // Setup builtin library mock for 'print' in coreimpl.
+ const char* builtin_source =
+ "#library('dart:builtin');\n"
+ "void print(Object o) { }";
+ Dart_Handle coreimpl = Dart_LookupLibrary(Dart_NewString("dart:coreimpl"));
+ EXPECT_VALID(coreimpl);
+ Dart_Handle builtin = Dart_LoadLibrary(Dart_NewString("dart:builtin"),
+ Dart_NewString(builtin_source));
+ EXPECT_VALID(builtin);
+ Dart_Handle imported =
+ Dart_LibraryImportLibrary(coreimpl, builtin, Dart_NewString("builtin"));
+ EXPECT_VALID(imported);
}
~BenchmarkIsolateScope() {
Dart_ExitScope(); // Exit the Dart API scope created for unit tests.

Powered by Google App Engine
This is Rietveld 408576698