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

Unified Diff: test/codegen/expect/BenchmarkBase/BenchmarkBase.js

Issue 968273002: Fixing layout in js output (use full paths rather than just the library name) (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 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
Index: test/codegen/expect/BenchmarkBase/BenchmarkBase.js
diff --git a/test/codegen/expect/BenchmarkBase/BenchmarkBase.js b/test/codegen/expect/BenchmarkBase/BenchmarkBase.js
deleted file mode 100644
index 462a7fc35ad8a7d421b8c648abb80a309d809b70..0000000000000000000000000000000000000000
--- a/test/codegen/expect/BenchmarkBase/BenchmarkBase.js
+++ /dev/null
@@ -1,69 +0,0 @@
-var BenchmarkBase;
-(function(BenchmarkBase) {
- 'use strict';
- class Expect extends dart.Object {
- static equals(expected, actual) {
- if (!dart.equals(expected, actual)) {
- throw `Values not equal: ${expected} vs ${actual}`;
- }
- }
- static listEquals(expected, actual) {
- if (expected.length !== actual.length) {
- throw `Lists have different lengths: ${expected.length} vs ${actual.length}`;
- }
- for (let i = 0; i < actual.length; i++) {
- equals(expected.get(i), actual.get(i));
- }
- }
- fail(message) {
- throw message;
- }
- }
- class BenchmarkBase extends dart.Object {
- BenchmarkBase(name) {
- this.name = name;
- }
- run() {}
- warmup() {
- this.run();
- }
- exercise() {
- for (let i = 0; i < 10; i++) {
- this.run();
- }
- }
- setup() {}
- teardown() {}
- static measureFor(f, timeMinimum) {
- let time = 0;
- let iter = 0;
- let watch = new core.Stopwatch();
- watch.start();
- let elapsed = 0;
- while (elapsed < timeMinimum) {
- dart.dinvokef(f);
- elapsed = watch.elapsedMilliseconds;
- iter++;
- }
- return 1000.0 * elapsed / iter;
- }
- measure() {
- this.setup();
- measureFor((() => {
- this.warmup();
- }).bind(this), 100);
- let result = measureFor((() => {
- this.exercise();
- }).bind(this), 2000);
- this.teardown();
- return result;
- }
- report() {
- let score = this.measure();
- core.print(`${this.name}(RunTime): ${score} us.`);
- }
- }
- // Exports:
- BenchmarkBase.Expect = Expect;
- BenchmarkBase.BenchmarkBase = BenchmarkBase;
-})(BenchmarkBase || (BenchmarkBase = {}));

Powered by Google App Engine
This is Rietveld 408576698