summaryrefslogtreecommitdiffstats
path: root/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests')
-rw-r--r--third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/destroy-app.js5
-rw-r--r--third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/module-for-acceptance.js23
-rw-r--r--third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/resolver.js11
-rw-r--r--third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/start-app.js18
-rw-r--r--third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/index.html33
-rw-r--r--third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/test-helper.js6
6 files changed, 96 insertions, 0 deletions
diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/destroy-app.js b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/destroy-app.js
new file mode 100644
index 0000000000..13d4989501
--- /dev/null
+++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/destroy-app.js
@@ -0,0 +1,5 @@
+import Ember from 'ember';
+
+export default function destroyApp(application) {
+ Ember.run(application, 'destroy');
+}
diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/module-for-acceptance.js b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/module-for-acceptance.js
new file mode 100644
index 0000000000..6fbe13500e
--- /dev/null
+++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/module-for-acceptance.js
@@ -0,0 +1,23 @@
+import { module } from 'qunit';
+import Ember from 'ember';
+import startApp from '../helpers/start-app';
+import destroyApp from '../helpers/destroy-app';
+
+const { RSVP: { Promise } } = Ember;
+
+export default function (name, options = {}) {
+ module(name, {
+ beforeEach() {
+ this.application = startApp();
+
+ if (options.beforeEach) {
+ options.beforeEach.apply(this, arguments);
+ }
+ },
+
+ afterEach() {
+ let afterEach = options.afterEach && options.afterEach.apply(this, arguments);
+ return Promise.resolve(afterEach).then(() => destroyApp(this.application));
+ }
+ });
+}
diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/resolver.js b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/resolver.js
new file mode 100644
index 0000000000..50e9179f54
--- /dev/null
+++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/resolver.js
@@ -0,0 +1,11 @@
+import Resolver from '../../resolver';
+import config from '../../config/environment';
+
+const resolver = Resolver.create();
+
+resolver.namespace = {
+ modulePrefix: config.modulePrefix,
+ podModulePrefix: config.podModulePrefix
+};
+
+export default resolver;
diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/start-app.js b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/start-app.js
new file mode 100644
index 0000000000..dd5f6a6361
--- /dev/null
+++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/start-app.js
@@ -0,0 +1,18 @@
+import Ember from 'ember';
+import Application from '../../app';
+import config from '../../config/environment';
+
+export default function startApp(attrs) {
+ let application;
+
+ // use defaults, but you can override
+ let attributes = Ember.assign({}, config.APP, attrs);
+
+ Ember.run(() => {
+ application = Application.create(attributes);
+ application.setupForTesting();
+ application.injectTestHelpers();
+ });
+
+ return application;
+}
diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/index.html b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/index.html
new file mode 100644
index 0000000000..112787f570
--- /dev/null
+++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/index.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <title>Todomvc Tests</title>
+ <meta name="description" content="">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+ {{content-for "head"}}
+ {{content-for "test-head"}}
+
+ <link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
+ <link rel="stylesheet" href="{{rootURL}}assets/todomvc.css">
+ <link rel="stylesheet" href="{{rootURL}}assets/test-support.css">
+
+ {{content-for "head-footer"}}
+ {{content-for "test-head-footer"}}
+ </head>
+ <body>
+ {{content-for "body"}}
+ {{content-for "test-body"}}
+
+ <script src="/testem.js" integrity=""></script>
+ <script src="{{rootURL}}assets/vendor.js"></script>
+ <script src="{{rootURL}}assets/test-support.js"></script>
+ <script src="{{rootURL}}assets/todomvc.js"></script>
+ <script src="{{rootURL}}assets/tests.js"></script>
+
+ {{content-for "body-footer"}}
+ {{content-for "test-body-footer"}}
+ </body>
+</html>
diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/test-helper.js b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/test-helper.js
new file mode 100644
index 0000000000..dc9961fd56
--- /dev/null
+++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/test-helper.js
@@ -0,0 +1,6 @@
+import resolver from './helpers/resolver';
+import {
+ setResolver
+} from 'ember-qunit';
+
+setResolver(resolver);