summaryrefslogtreecommitdiffstats
path: root/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/module-for-acceptance.js
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/module-for-acceptance.js')
-rw-r--r--third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs/tests/helpers/module-for-acceptance.js23
1 files changed, 23 insertions, 0 deletions
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));
+ }
+ });
+}