Sha256: 997c5ea6409613a8fe4c10e2502ee78af46c3088d2810ee0937484e4d169b847

Contents?: true

Size: 1.94 KB

Versions: 4

Compression:

Stored size: 1.94 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            ©2008-2011 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

// ========================================================================
// RootResponder Tests
// ========================================================================
/*global module, test, ok, equals */

var responder;

module("SC.RootResponder", {
	setup: function() {
		responder = SC.RootResponder.create();
	},
	
	teardown: function() {
    responder.destroy();
  }
});

test("Basic requirements", function() {
  ok(SC.RootResponder, "SC.RootResponder");
  ok(SC.RootResponder.responder && SC.RootResponder.responder, "SC.RootResponder.responder");
  equals(
    SC.RootResponder.responder ? SC.RootResponder.responder.constructor : "no responder!",
    SC.RootResponder,
    "SC.RootResponder.responder is an instance of"
  );
});

test("root_responder.ignoreTouchHandle() : Should ignore TEXTAREA, INPUT, A, and SELECT elements", function () {
 var wasMobileSafari = SC.browser.isMobileSafari;
 SC.browser.isMobileSafari = YES;

 ["A", "INPUT", "TEXTAREA", "SELECT"].forEach(function (tag) {
   ok(responder.ignoreTouchHandle({
     target: { tagName: tag },
     allowDefault: SC.K
   }), "should pass touch events through to <" + tag + "> elements");
 });

 ["AUDIO", "B", "Q", "BR", "BODY", "BUTTON", "CANVAS", "FORM",
  "IFRAME", "IMG", "OPTION", "P", "PROGRESS", "STRONG",
  "TABLE", "TBODY", "TR", "TH", "TD", "VIDEO"].forEach(function (tag) {
   ok(!responder.ignoreTouchHandle({
     target: { tagName: tag },
     allowDefault: SC.K
   }), "should NOT pass touch events through to <" + tag + "> elements");
 });

 SC.browser.isMobileSafari = wasMobileSafari;
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/root_responder.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/root_responder.js
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/root_responder.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/root_responder.js