How to use handlers method in uiautomator

Best Python code snippet using uiautomator

translator_tests.py

Source:translator_tests.py Github

copy

Full Screen

...65 self.assertRaises(TranslatorError,66 Handlers,67 StringHandler("Main", ""),68 ((StringHandler("123", ""), StringHandler("123", "$")),))69 def test_handlers(self):70 handlers = Handlers(StringHandler("Main", "test"),71 ((StringHandler("12", "12\n"), StringHandler("123", "66\n55")),72 (StringHandler("1235", "%\n5\n334"),)))73 handlers.include("1235")74 handlers.include("12")75 handlers.include("123")76 self.assertIsInstance(iter(handlers), Handlers)77 self.assertTrue(bool(handlers))78 self.assertEqual(handlers.get_name(), "Main")79 self.assertIsNone(handlers.get_line_number())80 self.assertEqual(next(handlers), "test")81 self.assertEqual(handlers.get_name(), "Main")82 self.assertEqual(handlers.get_line_number(), 0)83 self.assertEqual(next(handlers), "%")...

Full Screen

Full Screen

delegate.js

Source:delegate.js Github

copy

Full Screen

1// (C) Copyright 2015 Martin Dougiamas2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7// http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.14angular.module('mm.core.courses')15/**16 * Service to interact with courses.17 *18 * @module mm.core.courses19 * @ngdoc service20 * @name $mmCoursesDelegate21 */22.provider('$mmCoursesDelegate', function() {23 var navHandlers = {},24 self = {};25 /**26 * Register a navigation handler.27 *28 * @module mm.core.courses29 * @ngdoc method30 * @name $mmCoursesDelegate#registerNavHandler31 * @param {String} addon The addon's name (mmaLabel, mmaForum, ...)32 * @param {String|Object|Function} handler Must be resolved to an object defining the following functions. Or to a function33 * returning an object defining these functions. See {@link $mmUtil#resolveObject}.34 * - isEnabled (Boolean|Promise) Whether or not the handler is enabled on a site level.35 * When using a promise, it should return a boolean.36 * - isEnabledForCourse(courseid, accessData) (Boolean|Promise) Whether or not the handler is37 * enabled on a course level. When using a promise, it should return a boolean.38 * - getController(courseid) (Object) Returns the object that will act as controller.39 * See core/components/courses/templates/list.html40 * for the list of scope variables expected.41 */42 self.registerNavHandler = function(addon, handler, priority) {43 if (typeof navHandlers[addon] !== 'undefined') {44 console.log("$mmCoursesDelegateProvider: Addon '" + navHandlers[addon].addon + "' already registered as navigation handler");45 return false;46 }47 console.log("$mmCoursesDelegateProvider: Registered addon '" + addon + "' as navibation handler.");48 navHandlers[addon] = {49 addon: addon,50 handler: handler,51 instance: undefined,52 priority: priority53 };54 return true;55 };56 self.$get = function($mmUtil, $q, $log, $mmSite, mmCoursesAccessMethods) {57 var enabledNavHandlers = {},58 coursesHandlers = {},59 self = {},60 loaded = {},61 lastUpdateHandlersStart,62 lastUpdateHandlersForCoursesStart = {};63 $log = $log.getInstance('$mmCoursesDelegate');64 /**65 * Check if addons are loaded for a certain course.66 *67 * @module mm.core.courses68 * @ngdoc method69 * @name $mmCoursesDelegate#areNavHandlersLoadedFor70 * @param {Number} courseId The course ID.71 * @return {Boolean} True if addons are loaded, false otherwise.72 */73 self.areNavHandlersLoadedFor = function(courseId) {74 return loaded[courseId];75 };76 /**77 * Clear all courses handlers.78 *79 * @module mm.core.courses80 * @ngdoc method81 * @name $mmCoursesDelegate#clearCoursesHandlers82 * @protected83 */84 self.clearCoursesHandlers = function() {85 coursesHandlers = {};86 loaded = {};87 };88 /**89 * Get the handler for a course using a certain access type.90 *91 * @param {Number} courseId The course ID.92 * @param {Boolean} refresh True if it should refresh the list.93 * @param {Object} accessData Access type and data. Default, guest, ...94 * @return {Array} Array of objects containing 'priority' and 'controller'.95 */96 function getNavHandlersForAccess(courseId, refresh, accessData) {97 if (refresh || !coursesHandlers[courseId] || coursesHandlers[courseId].access.type != accessData.type) {98 coursesHandlers[courseId] = {99 access: accessData,100 handlers: []101 };102 self.updateNavHandlersForCourse(courseId, accessData);103 }104 return coursesHandlers[courseId].handlers;105 }106 /**107 * Get the handlers for a course where the user is enrolled in.108 *109 * @module mm.core.courses110 * @ngdoc method111 * @name $mmCoursesDelegate#getNavHandlersFor112 * @param {Number} courseId The course ID.113 * @param {Boolean} refresh True if it should refresh the list.114 * @return {Array} Array of objects containing 'priority' and 'controller'.115 */116 self.getNavHandlersFor = function(courseId, refresh) {117 // Default access.118 var accessData = {119 type: mmCoursesAccessMethods.default120 };121 return getNavHandlersForAccess(courseId, refresh, accessData);122 };123 /**124 * Get the handlers for a course as guest.125 *126 * @module mm.core.courses127 * @ngdoc method128 * @name $mmCoursesDelegate#getNavHandlersForGuest129 * @param {Number} courseId The course ID.130 * @param {Boolean} refresh True if it should refresh the list.131 * @return {Array} Array of objects containing 'priority' and 'controller'.132 */133 self.getNavHandlersForGuest = function(courseId, refresh) {134 // Guest access.135 var accessData = {136 type: mmCoursesAccessMethods.guest137 };138 return getNavHandlersForAccess(courseId, refresh, accessData);139 };140 /**141 * Check if a time belongs to the last update handlers call.142 * This is to handle the cases where updateNavHandlers don't finish in the same order as they're called.143 *144 * @module mm.core.courses145 * @ngdoc method146 * @name $mmCoursesDelegate#isLastUpdateCall147 * @param {Number} time Time to check.148 * @return {Boolean} True if equal, false otherwise.149 */150 self.isLastUpdateCall = function(time) {151 if (!lastUpdateHandlersStart) {152 return true;153 }154 return time == lastUpdateHandlersStart;155 };156 /**157 * Check if a time belongs to the last update handlers for course call.158 * This is to handle the cases where updateNavHandlersForCourse don't finish in the same order as they're called.159 *160 * @module mm.core.courses161 * @ngdoc method162 * @name $mmCoursesDelegate#isLastUpdateCourseCall163 * @param {Number} courseId Course ID.164 * @param {Number} time Time to check.165 * @return {Boolean} True if equal, false otherwise.166 */167 self.isLastUpdateCourseCall = function(courseId, time) {168 if (!lastUpdateHandlersForCoursesStart[courseId]) {169 return true;170 }171 return time == lastUpdateHandlersForCoursesStart[courseId];172 };173 /**174 * Update the handler for the current site.175 *176 * @module mm.core.courses177 * @ngdoc method178 * @name $mmCoursesDelegate#updateNavHandler179 * @param {String} addon The addon.180 * @param {Object} handlerInfo The handler details.181 * @param {Number} time Time this update process started.182 * @return {Promise} Resolved when enabled, rejected when not.183 * @protected184 */185 self.updateNavHandler = function(addon, handlerInfo, time) {186 var promise,187 siteId = $mmSite.getId();188 if (typeof handlerInfo.instance === 'undefined') {189 handlerInfo.instance = $mmUtil.resolveObject(handlerInfo.handler, true);190 }191 if (!$mmSite.isLoggedIn()) {192 promise = $q.reject();193 } else {194 promise = $q.when(handlerInfo.instance.isEnabled());195 }196 // Checks if the content is enabled.197 return promise.catch(function() {198 return false;199 }).then(function(enabled) {200 // Verify that this call is the last one that was started.201 // Check that site hasn't changed since the check started.202 if (self.isLastUpdateCall(time) && $mmSite.isLoggedIn() && $mmSite.getId() === siteId) {203 if (enabled) {204 enabledNavHandlers[addon] = {205 instance: handlerInfo.instance,206 priority: handlerInfo.priority207 };208 } else {209 delete enabledNavHandlers[addon];210 }211 }212 });213 };214 /**215 * Update the handlers for the current site.216 *217 * @module mm.core.courses218 * @ngdoc method219 * @name $mmCoursesDelegate#updateNavHandlers220 * @return {Promise} Resolved when done.221 * @protected222 */223 self.updateNavHandlers = function() {224 var promises = [],225 siteId = $mmSite.getId(),226 now = new Date().getTime();227 $log.debug('Updating navigation handlers for current site.');228 lastUpdateHandlersStart = now;229 // Loop over all the content handlers.230 angular.forEach(navHandlers, function(handlerInfo, addon) {231 promises.push(self.updateNavHandler(addon, handlerInfo, now));232 });233 return $q.all(promises).then(function() {234 return true;235 }, function() {236 // Never reject.237 return true;238 }).finally(function() {239 // Verify that this call is the last one that was started.240 // Check that site hasn't changed since the check started.241 if (self.isLastUpdateCall(now) && $mmSite.isLoggedIn() && $mmSite.getId() === siteId) {242 // Update handlers for all courses.243 angular.forEach(coursesHandlers, function(handler, courseId) {244 self.updateNavHandlersForCourse(parseInt(courseId), handler.access);245 });246 }247 });248 };249 /**250 * Update the handlers for a certain course.251 *252 * @module mm.core.courses253 * @ngdoc method254 * @name $mmCoursesDelegate#updateNavHandlersForCourse255 * @param {Number} courseId The course ID.256 * @param {Object} accessData Access type and data. Default, guest, ...257 * @return {Promise} Resolved when updated.258 * @protected259 */260 self.updateNavHandlersForCourse = function(courseId, accessData) {261 var promises = [],262 enabledForCourse = [],263 siteId = $mmSite.getId(),264 now = new Date().getTime();265 lastUpdateHandlersForCoursesStart[courseId] = now;266 angular.forEach(enabledNavHandlers, function(handler) {267 // Checks if the handler is enabled for the user.268 var promise = $q.when(handler.instance.isEnabledForCourse(courseId, accessData)).then(function(enabled) {269 if (enabled) {270 enabledForCourse.push(handler);271 } else {272 return $q.reject();273 }274 }).catch(function() {275 // Nothing to do here, it is not enabled for this user.276 });277 promises.push(promise);278 });279 return $q.all(promises).then(function() {280 return true;281 }).catch(function() {282 // Never fails.283 return true;284 }).finally(function() {285 // Verify that this call is the last one that was started.286 // Check that site hasn't changed since the check started.287 if (self.isLastUpdateCourseCall(courseId, now) && $mmSite.isLoggedIn() && $mmSite.getId() === siteId) {288 // Update the coursesHandlers array with the new enabled addons.289 $mmUtil.emptyArray(coursesHandlers[courseId].handlers);290 angular.forEach(enabledForCourse, function(handler) {291 coursesHandlers[courseId].handlers.push({292 controller: handler.instance.getController(courseId),293 priority: handler.priority294 });295 });296 loaded[courseId] = true;297 }298 });299 };300 return self;301 };302 return self;...

Full Screen

Full Screen

handlers.js

Source:handlers.js Github

copy

Full Screen

1// Copyright 2014 Cognitect. All Rights Reserved.2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7// http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS-IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.14goog.provide("com.cognitect.transit.handlers");15goog.require("com.cognitect.transit.util");16goog.require("com.cognitect.transit.types");17goog.require("goog.math.Long");18goog.scope(function () {19 var handlers = com.cognitect.transit.handlers,20 util = com.cognitect.transit.util,21 types = com.cognitect.transit.types,22 Long = goog.math.Long;23 handlers.ctorGuid = 0;24 /**25 * @const26 * @type {string}27 */28 handlers.ctorGuidProperty = "transit$guid$" + util.randomUUID();29 handlers.typeTag = function (ctor) {30 if (ctor == null) {31 return "null";32 } else if (ctor === String) {33 return "string";34 } else if (ctor === Boolean) {35 return "boolean";36 } else if (ctor === Number) {37 return "number";38 } else if (ctor === Array) {39 return "array";40 } else if (ctor === Object) {41 return "map";42 } else {43 var tag = ctor[handlers.ctorGuidProperty];44 if (tag == null) {45 if (typeof Object.defineProperty != "undefined") {46 tag = ++handlers.ctorGuid;47 Object.defineProperty(ctor, handlers.ctorGuidProperty, {48 value: tag,49 enumerable: false50 });51 } else {52 ctor[handlers.ctorGuidProperty] = tag = ++handlers.ctorGuid;53 }54 }55 return tag;56 }57 };58 handlers.constructor = function (x) {59 if (x == null) {60 return null;61 } else {62 return x.constructor;63 }64 };65 handlers.padZeros = function (n, m) {66 var s = n.toString();67 for (var i = s.length; i < m; i++) {68 s = "0" + s;69 }70 return s;71 };72 handlers.stringableKeys = function (m) {73 var stringable = false,74 ks = util.objectKeys(m);75 for (var i = 0; i < ks.length; i++) {76 }77 return true;78 };79 /**80 * @constructor81 */82 handlers.NilHandler = function Transit$NilHandler() {83 };84 handlers.NilHandler.prototype.tag = function (v) {85 return "_";86 };87 handlers.NilHandler.prototype.rep = function (v) {88 return null;89 };90 handlers.NilHandler.prototype.stringRep = function (v) {91 return "null";92 };93 /**94 * @constructor95 */96 handlers.StringHandler = function Transit$StringHandler() {97 };98 handlers.StringHandler.prototype.tag = function (v) {99 return "s";100 };101 handlers.StringHandler.prototype.rep = function (v) {102 return v;103 };104 handlers.StringHandler.prototype.stringRep = function (v) {105 return v;106 };107 /**108 * @constructor109 */110 handlers.NumberHandler = function Transit$NumberHandler() {111 };112 handlers.NumberHandler.prototype.tag = function (v) {113 return "i";114 };115 handlers.NumberHandler.prototype.rep = function (v) {116 return v;117 };118 handlers.NumberHandler.prototype.stringRep = function (v) {119 return v.toString();120 };121 /**122 * @constructor123 */124 handlers.IntegerHandler = function Transit$IntegerHandler() {125 };126 handlers.IntegerHandler.prototype.tag = function (v) {127 return "i";128 };129 handlers.IntegerHandler.prototype.rep = function (v) {130 return v.toString();131 };132 handlers.IntegerHandler.prototype.stringRep = function (v) {133 return v.toString();134 };135 /**136 * @constructor137 */138 handlers.BooleanHandler = function Transit$BooleanHandler() {139 };140 handlers.BooleanHandler.prototype.tag = function (v) {141 return "?";142 };143 handlers.BooleanHandler.prototype.rep = function (v) {144 return v;145 };146 handlers.BooleanHandler.prototype.stringRep = function (v) {147 return v.toString();148 };149 /**150 * @constructor151 */152 handlers.ArrayHandler = function Transit$ArrayHandler() {153 };154 handlers.ArrayHandler.prototype.tag = function (v) {155 return "array";156 };157 handlers.ArrayHandler.prototype.rep = function (v) {158 return v;159 };160 handlers.ArrayHandler.prototype.stringRep = function (v) {161 return null;162 };163 /**164 * @constructor165 */166 handlers.MapHandler = function Transit$MapHandler() {167 };168 handlers.MapHandler.prototype.tag = function (v) {169 return "map";170 };171 handlers.MapHandler.prototype.rep = function (v) {172 return v;173 };174 handlers.MapHandler.prototype.stringRep = function (v) {175 return null;176 };177 /**178 * @constructor179 */180 handlers.VerboseDateHandler = function Transit$VerboseDateHandler() {181 };182 handlers.VerboseDateHandler.prototype.tag = function (v) {183 return "t";184 };185 handlers.VerboseDateHandler.prototype.rep = function (v) {186 return v.getUTCFullYear() + "-" + handlers.padZeros(v.getUTCMonth() + 1, 2) + "-" +187 handlers.padZeros(v.getUTCDate(), 2) + "T" + handlers.padZeros(v.getUTCHours(), 2) + ":" +188 handlers.padZeros(v.getUTCMinutes(), 2) + ":" + handlers.padZeros(v.getUTCSeconds(), 2) + "." +189 handlers.padZeros(v.getUTCMilliseconds(), 3) + "Z";190 };191 handlers.VerboseDateHandler.prototype.stringRep = function (v, h) {192 return h.rep(v);193 };194 /**195 * @constructor196 */197 handlers.DateHandler = function Transit$DateHandler() {198 };199 handlers.DateHandler.prototype.tag = function (v) {200 return "m";201 };202 handlers.DateHandler.prototype.rep = function (v) {203 return v.valueOf();204 };205 handlers.DateHandler.prototype.stringRep = function (v) {206 return v.valueOf().toString();207 };208 handlers.DateHandler.prototype.getVerboseHandler = function (v) {209 return new handlers.VerboseDateHandler();210 };211 /**212 * @constructor213 */214 handlers.UUIDHandler = function Transit$UUIDHandler() {215 };216 handlers.UUIDHandler.prototype.tag = function (v) {217 return "u";218 };219 handlers.UUIDHandler.prototype.rep = function (v) {220 return v.toString();221 };222 handlers.UUIDHandler.prototype.stringRep = function (v) {223 return v.toString();224 };225 /**226 * @constructor227 */228 handlers.KeywordHandler = function Transit$KeywordHandler() {229 };230 handlers.KeywordHandler.prototype.tag = function (v) {231 return ":";232 };233 handlers.KeywordHandler.prototype.rep = function (v) {234 return v._name;235 }; // NOTE: should be fqn236 handlers.KeywordHandler.prototype.stringRep = function (v, h) {237 return h.rep(v);238 };239 /**240 * @constructor241 */242 handlers.SymbolHandler = function Transit$SymbolHandler() {243 };244 handlers.SymbolHandler.prototype.tag = function (v) {245 return "$";246 };247 handlers.SymbolHandler.prototype.rep = function (v) {248 return v._name;249 }; // NOTE: should be str250 handlers.SymbolHandler.prototype.stringRep = function (v, h) {251 return h.rep(v);252 };253 /**254 * @constructor255 */256 handlers.TaggedHandler = function Transit$TaggedHandler() {257 };258 handlers.TaggedHandler.prototype.tag = function (v) {259 return v.tag;260 };261 handlers.TaggedHandler.prototype.rep = function (v) {262 return v.rep;263 };264 handlers.TaggedHandler.prototype.stringRep = function (v, h) {265 return null;266 };267 /**268 * @constructor269 */270 handlers.TransitSetHandler = function Transit$TransitSetHandler() {271 };272 handlers.TransitSetHandler.prototype.tag = function (v) {273 return "set";274 };275 handlers.TransitSetHandler.prototype.rep = function (v) {276 var arr = [];277 v.forEach(function (key, set) {278 arr.push(key);279 });280 return types.taggedValue("array", arr);281 };282 handlers.TransitSetHandler.prototype.stringRep = function (v, h) {283 return null;284 };285 /**286 * @constructor287 */288 handlers.TransitArrayMapHandler = function Transit$ArrayMapHandler() {289 };290 handlers.TransitArrayMapHandler.prototype.tag = function (v) {291 return "map";292 };293 handlers.TransitArrayMapHandler.prototype.rep = function (v) {294 return v;295 };296 handlers.TransitArrayMapHandler.prototype.stringRep = function (v, h) {297 return null;298 };299 /**300 * @constructor301 */302 handlers.TransitMapHandler = function Transit$MapHandler() {303 };304 handlers.TransitMapHandler.prototype.tag = function (v) {305 return "map";306 };307 handlers.TransitMapHandler.prototype.rep = function (v) {308 return v;309 };310 handlers.TransitMapHandler.prototype.stringRep = function (v, h) {311 return null;312 };313 /**314 * @constructor315 */316 handlers.BufferHandler = function Transit$BufferHandler() {317 };318 handlers.BufferHandler.prototype.tag = function (v) {319 return "b";320 };321 handlers.BufferHandler.prototype.rep = function (v) {322 return v.toString("base64");323 };324 handlers.BufferHandler.prototype.stringRep = function (v, h) {325 return null;326 };327 /**328 * @constructor329 */330 handlers.Uint8ArrayHandler = function Transit$Uint8ArrayHandler() {331 };332 handlers.Uint8ArrayHandler.prototype.tag = function (v) {333 return "b";334 };335 handlers.Uint8ArrayHandler.prototype.rep = function (v) {336 return util.Uint8ToBase64(v);337 };338 handlers.Uint8ArrayHandler.prototype.stringRep = function (v, h) {339 return null;340 };341 handlers.defaultHandlers = function (hs) {342 hs.set(null, new handlers.NilHandler());343 hs.set(String, new handlers.StringHandler());344 hs.set(Number, new handlers.NumberHandler());345 hs.set(Long, new handlers.IntegerHandler());346 hs.set(Boolean, new handlers.BooleanHandler());347 hs.set(Array, new handlers.ArrayHandler());348 hs.set(Object, new handlers.MapHandler());349 hs.set(Date, new handlers.DateHandler());350 hs.set(types.UUID, new handlers.UUIDHandler());351 hs.set(types.Keyword, new handlers.KeywordHandler());352 hs.set(types.Symbol, new handlers.SymbolHandler());353 hs.set(types.TaggedValue, new handlers.TaggedHandler());354 hs.set(types.TransitSet, new handlers.TransitSetHandler());355 hs.set(types.TransitArrayMap, new handlers.TransitArrayMapHandler());356 hs.set(types.TransitMap, new handlers.TransitMapHandler());357 if (typeof Buffer != "undefined") {358 hs.set(Buffer, new handlers.BufferHandler());359 }360 if (typeof Uint8Array != "undefined") {361 hs.set(Uint8Array, new handlers.Uint8ArrayHandler());362 }363 return hs;364 };365 /**366 * @constructor367 */368 handlers.Handlers = function Transit$Handlers() {369 this.handlers = {};370 handlers.defaultHandlers(this);371 };372 handlers.Handlers.prototype.get = function (ctor) {373 var h = null;374 if (typeof ctor === "string") {375 h = this.handlers[ctor];376 } else {377 h = this.handlers[handlers.typeTag(ctor)];378 }379 if (h != null) {380 return h;381 } else {382 return this.handlers["default"];383 }384 };385 handlers.Handlers.prototype["get"] = handlers.Handlers.prototype.get;386 handlers.validTag = function (tag) {387 switch (tag) {388 case "null":389 case "string":390 case "boolean":391 case "number":392 case "array":393 case "map":394 return false;395 break;396 }397 return true;398 };399 handlers.Handlers.prototype.set = function (ctor, handler) {400 if (typeof ctor === "string" && handlers.validTag(ctor)) {401 this.handlers[ctor] = handler;402 } else {403 this.handlers[handlers.typeTag(ctor)] = handler;404 }405 };...

Full Screen

Full Screen

handler_options.js

Source:handler_options.js Github

copy

Full Screen

1// Copyright (c) 2012 The Chromium Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4/**5 * @typedef {{6 * default_handler: number,7 * handlers: Array,8 * has_policy_recommendations: boolean,9 * is_default_handler_set_by_user: boolean,10 * protocol: string11 * }}12 * @see chrome/browser/ui/webui/options/handler_options_handler.cc13 */14var Handlers;15cr.define('options', function() {16 /** @const */ var Page = cr.ui.pageManager.Page;17 /** @const */ var PageManager = cr.ui.pageManager.PageManager;18 /////////////////////////////////////////////////////////////////////////////19 // HandlerOptions class:20 /**21 * Encapsulated handling of handler options page.22 * @constructor23 * @extends {cr.ui.pageManager.Page}24 */25 function HandlerOptions() {26 this.activeNavTab = null;27 Page.call(this,28 'handlers',29 loadTimeData.getString('handlersPageTabTitle'),30 'handler-options');31 }32 cr.addSingletonGetter(HandlerOptions);33 HandlerOptions.prototype = {34 __proto__: Page.prototype,35 /**36 * The handlers list.37 * @type {options.HandlersList}38 * @private39 */40 handlersList_: null,41 /** @override */42 initializePage: function() {43 Page.prototype.initializePage.call(this);44 this.createHandlersList_();45 $('handler-options-overlay-confirm').onclick =46 PageManager.closeOverlay.bind(PageManager);47 },48 /**49 * Creates, decorates and initializes the handlers list.50 * @private51 */52 createHandlersList_: function() {53 var handlersList = $('handlers-list');54 options.HandlersList.decorate(handlersList);55 this.handlersList_ = assertInstanceof(handlersList, options.HandlersList);56 this.handlersList_.autoExpands = true;57 var ignoredHandlersList = $('ignored-handlers-list');58 options.IgnoredHandlersList.decorate(ignoredHandlersList);59 this.ignoredHandlersList_ = assertInstanceof(ignoredHandlersList,60 options.IgnoredHandlersList);61 this.ignoredHandlersList_.autoExpands = true;62 },63 };64 /**65 * Sets the list of handlers shown by the view.66 * @param {Array<Handlers>} handlers Handlers to be shown in the view.67 */68 HandlerOptions.setHandlers = function(handlers) {69 $('handlers-list').setHandlers(handlers);70 };71 /**72 * Sets the list of ignored handlers shown by the view.73 * @param {Array} handlers Handlers to be shown in the view.74 */75 HandlerOptions.setIgnoredHandlers = function(handlers) {76 $('ignored-handlers-section').hidden = handlers.length == 0;77 $('ignored-handlers-list').setHandlers(handlers);78 };79 return {80 HandlerOptions: HandlerOptions81 };...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run uiautomator automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful