From 2430f52bb97fa9d682e5f028c977c5bf94c5ec38 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 23 Mar 2012 14:03:24 -0700 Subject: chore(module): move files around in preparation for more modules --- src/scenario/Application.js | 102 ---------- src/scenario/Describe.js | 155 -------------- src/scenario/Future.js | 64 ------ src/scenario/ObjectModel.js | 247 ---------------------- src/scenario/Runner.js | 227 --------------------- src/scenario/Scenario.js | 417 -------------------------------------- src/scenario/SpecRunner.js | 145 ------------- src/scenario/angular-bootstrap.js | 60 ------ src/scenario/angular.prefix | 7 - src/scenario/angular.suffix | 22 -- src/scenario/dsl.js | 405 ------------------------------------ src/scenario/matchers.js | 45 ---- src/scenario/output/Html.js | 171 ---------------- src/scenario/output/Json.js | 10 - src/scenario/output/Object.js | 8 - src/scenario/output/Xml.js | 51 ----- 16 files changed, 2136 deletions(-) delete mode 100644 src/scenario/Application.js delete mode 100644 src/scenario/Describe.js delete mode 100644 src/scenario/Future.js delete mode 100644 src/scenario/ObjectModel.js delete mode 100644 src/scenario/Runner.js delete mode 100644 src/scenario/Scenario.js delete mode 100644 src/scenario/SpecRunner.js delete mode 100644 src/scenario/angular-bootstrap.js delete mode 100644 src/scenario/angular.prefix delete mode 100644 src/scenario/angular.suffix delete mode 100644 src/scenario/dsl.js delete mode 100644 src/scenario/matchers.js delete mode 100644 src/scenario/output/Html.js delete mode 100644 src/scenario/output/Json.js delete mode 100644 src/scenario/output/Object.js delete mode 100644 src/scenario/output/Xml.js (limited to 'src/scenario') diff --git a/src/scenario/Application.js b/src/scenario/Application.js deleted file mode 100644 index d3a70569..00000000 --- a/src/scenario/Application.js +++ /dev/null @@ -1,102 +0,0 @@ -'use strict'; - -/** - * Represents the application currently being tested and abstracts usage - * of iframes or separate windows. - * - * @param {Object} context jQuery wrapper around HTML context. - */ -angular.scenario.Application = function(context) { - this.context = context; - context.append( - '

Current URL: None

' + - '
' - ); -}; - -/** - * Gets the jQuery collection of frames. Don't use this directly because - * frames may go stale. - * - * @private - * @return {Object} jQuery collection - */ -angular.scenario.Application.prototype.getFrame_ = function() { - return this.context.find('#test-frames iframe:last'); -}; - -/** - * Gets the window of the test runner frame. Always favor executeAction() - * instead of this method since it prevents you from getting a stale window. - * - * @private - * @return {Object} the window of the frame - */ -angular.scenario.Application.prototype.getWindow_ = function() { - var contentWindow = this.getFrame_().prop('contentWindow'); - if (!contentWindow) - throw 'Frame window is not accessible.'; - return contentWindow; -}; - -/** - * Changes the location of the frame. - * - * @param {string} url The URL. If it begins with a # then only the - * hash of the page is changed. - * @param {function()} loadFn function($window, $document) Called when frame loads. - * @param {function()} errorFn function(error) Called if any error when loading. - */ -angular.scenario.Application.prototype.navigateTo = function(url, loadFn, errorFn) { - var self = this; - var frame = this.getFrame_(); - //TODO(esprehn): Refactor to use rethrow() - errorFn = errorFn || function(e) { throw e; }; - if (url === 'about:blank') { - errorFn('Sandbox Error: Navigating to about:blank is not allowed.'); - } else if (url.charAt(0) === '#') { - url = frame.attr('src').split('#')[0] + url; - frame.attr('src', url); - this.executeAction(loadFn); - } else { - frame.remove(); - this.context.find('#test-frames').append('