From fcee30c27eede25c1fa95077e4de9ac6b3d3ab2c Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 29 Dec 2015 12:58:24 -0800 Subject: [PATCH] [Mobile] Test agentService.isTouch --- platform/commonUI/mobile/test/AgentServiceSpec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platform/commonUI/mobile/test/AgentServiceSpec.js b/platform/commonUI/mobile/test/AgentServiceSpec.js index 573e72ddfb..be5fdaf6c5 100644 --- a/platform/commonUI/mobile/test/AgentServiceSpec.js +++ b/platform/commonUI/mobile/test/AgentServiceSpec.js @@ -82,6 +82,15 @@ define( expect(agentService.isLandscape()).toBeFalsy(); }); + it("detects touch support", function () { + testWindow.ontouchstart = null; + expect(new AgentService(testWindow).isTouch()) + .toBe(true); + delete testWindow.ontouchstart; + expect(new AgentService(testWindow).isTouch()) + .toBe(false); + }); + it("allows for checking browser type", function () { testWindow.navigator.userAgent = "Chromezilla Safarifox"; agentService = new AgentService(testWindow);