Best JavaScript code snippet using wpt
pcSample.js
Source:pcSample.js  
1define(function(require) {2	//grid3	require("w!$UI/demo/pcSample/grid/additionalRow.w");4	require("w!$UI/demo/pcSample/grid/bigData.w");5	require("w!$UI/demo/pcSample/grid/contentFormatting.w");6	require("w!$UI/demo/pcSample/grid/controlScrollbar.w");7	require("w!$UI/demo/pcSample/grid/customStyle.w");8	require("w!$UI/demo/pcSample/grid/dataSummarization.w");9	require("w!$UI/demo/pcSample/grid/doubleSelection.w");10	require("w!$UI/demo/pcSample/grid/doubleSelectionTransverse.w");11	require("w!$UI/demo/pcSample/grid/doubleSelectionVetical.w");12	require("w!$UI/demo/pcSample/grid/dynamicOperation.w");13	require("w!$UI/demo/pcSample/grid/dynamicSelect.w");14	require("w!$UI/demo/pcSample/grid/dynamicURL.w");15	require("w!$UI/demo/pcSample/grid/frozenColumn.w");16	require("w!$UI/demo/pcSample/grid/grouping-widthAdaptive.w");17	require("w!$UI/demo/pcSample/grid/grouping.w");18	require("w!$UI/demo/pcSample/grid/headerFilter.w");19	require("w!$UI/demo/pcSample/grid/grid/hideXscrollbar.w");20	require("w!$UI/demo/pcSample/grid/masterDetail-operate.w");21	require("w!$UI/demo/pcSample/grid/masterDetail.w");22	require("w!$UI/demo/pcSample/grid/mutiHeaders.w");23	require("w!$UI/demo/pcSample/grid/pagingMemory.w");24	require("w!$UI/demo/pcSample/grid/popupGrid.w");25	require("w!$UI/demo/pcSample/grid/rowRendering.w");26	require("w!$UI/demo/pcSample/grid/switchingGrid.w");27	require("w!$UI/demo/pcSample/grid/toolbarControl.w");28	require("w!$UI/demo/pcSample/grid/treeGrid-onceloading.w");29	require("w!$UI/demo/pcSample/grid/treeGrid-personalSetting.w");30	require("w!$UI/demo/pcSample/grid/treeGrid.w");31	//forms32	require("w!$UI/demo/pcSample/forms/asynchEdit.w");33	require("w!$UI/demo/pcSample/forms/asynchronous.w");34	require("w!$UI/demo/pcSample/forms/synchEdit.w");35	require("w!$UI/demo/pcSample/forms/Synchronous.w");36	require("w!$UI/demo/pcSample/forms/dynamicForm.w");37	require("w!$UI/demo/pcSample/forms/formDisable.w");38	require("w!$UI/demo/pcSample/forms/formElement.w");39	require("w!$UI/demo/pcSample/forms/formLayout.w");40	require("w!$UI/demo/pcSample/forms/formMode.w");41	require("w!$UI/demo/pcSample/forms/formSplit.w");42	require("w!$UI/demo/pcSample/forms/formTest.w");43	require("w!$UI/demo/pcSample/forms/responseLayout.w");44	//text45	require("w!$UI/demo/pcSample/text/articleList.w");46	require("w!$UI/demo/pcSample/text/changeColor.w");47	require("w!$UI/demo/pcSample/text/cutout.w");48	require("w!$UI/demo/pcSample/text/listeningTextChange.w");49	require("w!$UI/demo/pcSample/text/roll.w");50	//table51	require("w!$UI/demo/pcSample/table/basic/basic.w");52	require("w!$UI/demo/pcSample/table/basic/basictwo.w");53	require("w!$UI/demo/pcSample/table/basic/basicthree.w");54	require("w!$UI/demo/pcSample/table/basic/basicfour.w");55	require("w!$UI/demo/pcSample/table/basic/basicfive.w");56	require("w!$UI/demo/pcSample/table/basic/basicsix.w");57	require("w!$UI/demo/pcSample/table/basic/basicseven.w");58	require("w!$UI/demo/pcSample/table/basic/basiceight.w");59	require("w!$UI/demo/pcSample/table/basic/basicnine.w");60	require("w!$UI/demo/pcSample/table/basic/basicten.w");61	require("w!$UI/demo/pcSample/table/basic/basiceleven.w");62	require("w!$UI/demo/pcSample/table/basic/basictwelve.w");63	require("w!$UI/demo/pcSample/table/basic/basicthirteen.w");64	require("w!$UI/demo/pcSample/table/basic/basicfourteen.w");65	require("w!$UI/demo/pcSample/table/basic/basicfifteen.w");66	require("w!$UI/demo/pcSample/table/basic/basicsixteen.w");67	require("w!$UI/demo/pcSample/table/tableTemplate/tableTemplate.w");68	require("w!$UI/demo/pcSample/table/scrollX/scrollX.w");69	require("w!$UI/demo/pcSample/table/widowsDialog/windowsDialog.w");70	require("w!$UI/demo/pcSample/table/dynamicCreate/dynamicCreate.w");71	require("w!$UI/demo/pcSample/table/informationHint/informationHint.w");72	require("w!$UI/demo/pcSample/table/fatherAndSon/nestedTable.w");73	require("w!$UI/demo/pcSample/table/");74	require("w!$UI/demo/pcSample/table/");75	require("w!$UI/demo/pcSample/table/");76	require("w!$UI/demo/pcSample/table/");77	//form-element78	require("w!$UI/demo/pcSample/form-element/button.w");79	require("w!$UI/demo/pcSample/form-element/radio.w");80	require("w!$UI/demo/pcSample/form-element/checkBox.w");81	require("w!$UI/demo/pcSample/form-element/checkBox.w");82	require("w!$UI/demo/pcSample/form-element/select.w");83	require("w!$UI/demo/pcSample/form-element/fileUploadDown.w");84	require("w!$UI/demo/pcSample/form-element/fileUploadDown.w");85	require("w!$UI/demo/pcSample/form-element/filterConditionOne.w");86	require("w!$UI/demo/pcSample/form-element/filterConditionTwo.w");87	require("w!$UI/demo/pcSample/form-element/filterConditionThree.w");88	require("w!$UI/demo/pcSample/form-element/filterConditionFour.w");89	require("w!$UI/demo/pcSample/form-element/filterConditionFive.w");90	require("w!$UI/demo/pcSample/form-element/filterConditionSix.w");91	require("w!$UI/demo/pcSample/form-element/filterConditionSeven.w");92	require("w!$UI/demo/pcSample/form-element/filterConditionEight.w");93	require("w!$UI/demo/pcSample/form-element/starComment.w");94	require("w!$UI/demo/pcSample/form-element/text-box.w");95	require("w!$UI/demo/pcSample/form-element/textarea.w");96	//navigator97	require("w!$UI/demo/pcSample/navigator/basic-2.w");98	require("w!$UI/demo/pcSample/navigator/basic-flow.w");99	require("w!$UI/demo/pcSample/navigator/basic-staticFlow.w");100	require("w!$UI/demo/pcSample/navigator/Basic.w");101	require("w!$UI/demo/pcSample/navigator/digitalPaging.w");102	require("w!$UI/demo/pcSample/navigator/drawer.w");103	require("w!$UI/demo/pcSample/navigator/dynamicTAB.w");104	require("w!$UI/demo/pcSample/navigator/gridLine.w");105	require("w!$UI/demo/pcSample/navigator/iconKit.w");106	require("w!$UI/demo/pcSample/navigator/iconNav.w");107	require("w!$UI/demo/pcSample/navigator/popupMenu.w");108	require("w!$UI/demo/pcSample/navigator/toolbar.w");109	//layout110	require("w!$UI/demo/pcSample/layout/cross_navigation_flow.w");111	require("w!$UI/demo/pcSample/layout/cross_navigation_slide.w");112	require("w!$UI/demo/pcSample/layout/cross_navigation_tab.w");113	require("w!$UI/demo/pcSample/layout/cross_navigation1.w");114	require("w!$UI/demo/pcSample/layout/cross_vertical.w");115	require("w!$UI/demo/pcSample/layout/dic_maintenance.w");116	require("w!$UI/demo/pcSample/layout/dictionary_maintenance.w");117	require("w!$UI/demo/pcSample/layout/hint_user_card.w");118	require("w!$UI/demo/pcSample/layout/homepage_information_tab1.w");119	require("w!$UI/demo/pcSample/layout/homepage_information_tab2.w");120	require("w!$UI/demo/pcSample/layout/homepage_Sudoku.w");121	require("w!$UI/demo/pcSample/layout/local_rolling.w");122	require("w!$UI/demo/pcSample/layout/resource_distribute_role.w");123	require("w!$UI/demo/pcSample/layout/resource_distribute_user.w");124	require("w!$UI/demo/pcSample/layout/role_manage.w");125	require("w!$UI/demo/pcSample/layout/user_manage.w");126	require("w!$UI/demo/pcSample/layout/table_Echarts.w");127	require("w!$UI/demo/pcSample/layout/vertical_navigation_group.w");128	require("w!$UI/demo/pcSample/layout/vertical_navigation_link.w");129	require("w!$UI/demo/pcSample/layout/vertical_navigation_list.w");130	require("w!$UI/demo/pcSample/layout/vertical_navigation_slide.w");131	require("w!$UI/demo/pcSample/layout/vertical_tipwizard.w");132	133	return {134		"$children" : [{135			"$children" : [{136				"$name" : "item",137				"$text" : "",138				"display" : "solid",139				"label" : "表格跨åéå è¡",140				"psmCount" : "1",141				"url" : "$UI/demo/pcSample/grid/additionalRow.w"142			},{143				"$name" : "item",144				"$text" : "",145				"display" : "solid",146				"label" : "å¤§æ°æ®æµè¯",147				"psmCount" : "1",148				"url" : "$UI/demo/pcSample/grid/bigData.w"149			},{150				"$name" : "item",151				"$text" : "",152				"display" : "solid",153				"label" : "å
容格å¼å",154				"psmCount" : "1",155				"url" : "$UI/demo/pcSample/grid/contentFormatting.w"156			},{157				"$name" : "item",158				"$text" : "",159				"display" : "solid",160				"label" : "æ§å¶æ»å¨æ¡",161				"psmCount" : "1",162				"url" : "$UI/demo/pcSample/grid/controlScrollbar.w"163			},{164				"$name" : "item",165				"$text" : "",166				"display" : "solid",167				"label" : "个æ§åæ ·å¼",168				"psmCount" : "1",169				"url" : "$UI/demo/pcSample/grid/customStyle.w"170			}, {171				"$name" : "item",172				"$text" : "",173				"display" : "solid",174				"label" : "æ°æ®æ±æ»",175				"psmCount" : "1",176				"url" : "$UI/demo/pcSample/grid/dataSummarization.w"177			},{178				"$name" : "item",179				"$text" : "",180				"display" : "solid",181				"label" : "ååéæ©å¨",182				"psmCount" : "1",183				"url" : "$UI/demo/pcSample/grid/doubleSelection.w"184			},{185				"$name" : "item",186				"$text" : "",187				"display" : "solid",188				"label" : "ååéæ©å¨(横åéºæ»¡)",189				"psmCount" : "1",190				"url" : "$UI/demo/pcSample/grid/doubleSelectionTransverse.w"191			}, {192				"$name" : "item",193				"$text" : "",194				"display" : "solid",195				"label" : "ååéæ©å¨ï¼çºµåéºæ»¡ï¼",196				"psmCount" : "1",197				"url" : "$UI/demo/pcSample/grid/doubleSelectionVetical.w"198			}, {199				"$name" : "item",200				"$text" : "",201				"display" : "solid",202				"label" : "å¨æè¡¨æ ¼æä½",203				"psmCount" : "1",204				"url" : "$UI/demo/pcSample/grid/dynamicOperation.w"205			}, {206				"$name" : "item",207				"$text" : "",208				"display" : "solid",209				"label" : "卿鿩",210				"psmCount" : "1",211				"url" : "$UI/demo/pcSample/grid/dynamicSelect.w"212			}, {213				"$name" : "item",214				"$text" : "",215				"display" : "solid",216				"label" : "å¨æè®¾ç½®URL",217				"psmCount" : "1",218				"url" : "$UI/demo/pcSample/grid/dynamicURL.w"219			}, {220				"$name" : "item",221				"$text" : "",222				"display" : "solid",223				"label" : "å»ç»å",224				"psmCount" : "1",225				"url" : "$UI/demo/pcSample/grid/frozenColumn.w"226			}, {227				"$name" : "item",228				"$text" : "",229				"display" : "solid",230				"label" : "åç»è¡¨æ ¼ï¼å®½åº¦èªéåºï¼",231				"psmCount" : "1",232				"url" : "$UI/demo/pcSample/grid/grouping-widthAdaptive.w"233			}, {234				"$name" : "item",235				"$text" : "",236				"display" : "solid",237				"label" : "åç»è¡¨æ ¼",238				"psmCount" : "1",239				"url" : "$UI/demo/pcSample/grid/grouping.w"240			} ,{241				"$name" : "item",242				"$text" : "",243				"display" : "solid",244				"label" : "è¡¨å¤´è¿æ»¤",245				"psmCount" : "1",246				"url" : "$UI/demo/pcSample/grid/headerFilter.w"247			},{248				"$name" : "item",249				"$text" : "",250				"display" : "solid",251				"label" : "䏿¾ç¤ºæ¨ªåæ»å¨æ¡",252				"psmCount" : "1",253				"url" : "$UI/demo/pcSample/grid/hideXscrollbar.w"254			},{255				"$name" : "item",256				"$text" : "",257				"display" : "solid",258				"label" : "主ä»è¡¨æ ¼æä½",259				"psmCount" : "1",260				"url" : "$UI/demo/pcSample/grid/masterDetail-operate.w"261			},{262				"$name" : "item",263				"$text" : "",264				"display" : "solid",265				"label" : "主ä»è¡¨æ ¼",266				"psmCount" : "1",267				"url" : "$UI/demo/pcSample/grid/masterDetail.w"268			},{269				"$name" : "item",270				"$text" : "",271				"display" : "solid",272				"label" : "å¤è¡¨å¤´æ¯æ",273				"psmCount" : "1",274				"url" : "$UI/demo/pcSample/grid/mutiHeaders.w"275			},{276				"$name" : "item",277				"$text" : "",278				"display" : "solid",279				"label" : "鿩项å页记å¿",280				"psmCount" : "1",281				"url" : "$UI/demo/pcSample/grid/pagingMemory.w"282			},{283				"$name" : "item",284				"$text" : "",285				"display" : "solid",286				"label" : "å¼¹çªä¸ç表格",287				"psmCount" : "1",288				"url" : "$UI/demo/pcSample/grid/popupGrid.w"289			},{290				"$name" : "item",291				"$text" : "",292				"display" : "solid",293				"label" : "è¡å渲æ",294				"psmCount" : "1",295				"url" : "$UI/demo/pcSample/grid/rowRendering.w"296			},{297				"$name" : "item",298				"$text" : "",299				"display" : "solid",300				"label" : "å¨æåæ¢è¡¨æ ¼",301				"psmCount" : "1",302				"url" : "$UI/demo/pcSample/grid/switchingGrid.w"303			},{304				"$name" : "item",305				"$text" : "",306				"display" : "solid",307				"label" : "å·¥å
·æ æ§å¶",308				"psmCount" : "1",309				"url" : "$UI/demo/pcSample/grid/toolbarControl.w"310			},{311				"$name" : "item",312				"$text" : "",313				"display" : "solid",314				"label" : "æ å½¢è¡¨æ ¼ï¼ä¸æ¬¡å è½½ï¼",315				"psmCount" : "1",316				"url" : "$UI/demo/pcSample/grid/treeGrid-onceloading.w"317			},{318				"$name" : "item",319				"$text" : "",320				"display" : "solid",321				"label" : "æ å½¢è¡¨æ ¼ï¼ä¸ªæ§å设置ï¼",322				"psmCount" : "1",323				"url" : "$UI/demo/pcSample/grid/treeGrid-personalSetting.w"324			},{325				"$name" : "item",326				"$text" : "",327				"display" : "solid",328				"label" : "æ å½¢è¡¨æ ¼",329				"psmCount" : "1",330				"url" : "$UI/demo/pcSample/grid/treeGrid.w"331			}],			332			"$name" : "item",333			"$text" : "",334			"display" : "solid",335			"label" : "grid"336		}, {337			"$children" : [{338				"$name" : "item",339				"$text" : "",340				"display" : "solid",341				"label" : "弿¥ç¼è¾",342				"psmCount" : "1",343				"url" : "$UI/demo/pcSample/forms/asynchEdit.w"344			}, {345				"$name" : "item",346				"$text" : "",347				"display" : "solid",348				"label" : "弿¥æäº¤",349				"psmCount" : "1",350				"url" : "$UI/demo/pcSample/forms/asynchronous.w"351			}, {352				"$name" : "item",353				"$text" : "",354				"display" : "solid",355				"label" : "忥ç¼è¾",356				"psmCount" : "1",357				"url" : "$UI/demo/pcSample/forms/synchEdit.w"358			}, {359				"$name" : "item",360				"$text" : "",361				"display" : "solid",362				"label" : "忥æäº¤",363				"psmCount" : "1",364				"url" : "$UI/demo/pcSample/forms/Synchronous.w"365			/* scrollViewå¨å¤åçä¾åä¸å·²ç»ä½ç°366			}, {367				"$name" : "item",368				"$text" : "",369				"label" : "scrollView",370				"psmCount" : "1",371				"url" : "$UI/system/components/justep/scrollView/demo/list/demo.w"372			*/373			}, {374				"$name" : "item",375				"$text" : "",376				"display" : "solid",377				"label" : "卿å建表订åå¹¶èµå¼",378				"psmCount" : "1",379				"url" : "$UI/demo/pcSample/forms/dynamicForm.w"380			}, {381				"$name" : "item",382				"$text" : "",383				"display" : "solid",384				"label" : "表åç¦ç¨",385				"psmCount" : "1",386				"url" : "$UI/demo/pcSample/forms/formDisable.w"387			}, {388				"$name" : "item",389				"$text" : "",390				"display" : "solid",391				"label" : "表åå
ç´ ",392				"psmCount" : "1",393				"url" : "$UI/demo/pcSample/forms/formElement.w"394			}, {395				"$name" : "item",396				"$text" : "",397				"display" : "solid",398				"label" : "表å使ç¨",399				"psmCount" : "1",400				"url" : "$UI/demo/pcSample/forms/formLayout.w"401			},{402				"$name" : "item",403				"$text" : "",404				"display" : "solid",405				"label" : "è¡¨åæ¨¡å",406				"psmCount" : "1",407				"url" : "$UI/demo/pcSample/forms/formMode.w"408			},{409				"$name" : "item",410				"$text" : "",411				"display" : "solid",412				"label" : "表åæå",413				"psmCount" : "1",414				"url" : "$UI/demo/pcSample/forms/formSplit.w"415			}, {416				"$name" : "item",417				"$text" : "",418				"label" : "表åéªè¯",419				"psmCount" : "1",420				"url" : "$UI/demo/pcSample/forms/formTest.w"421			}, {422				"$name" : "item",423				"$text" : "",424				"display" : "solid",425				"label" : "表åååºå¼å¸å±",426				"psmCount" : "1",427				"url" : "$UI/demo/pcSample/forms/responseLayout.w"428			}],429			"$name" : "item",430			"$text" : "",431			"label" : "forms"432		} ,{433			"$children":[{434				"$name" : "item",435				"$text" : "",436				"label" : "徿 å±ç¤º",437				"psmCount" : "1",438				"url" : "$UI/demo/pcSample/text/articleList.w"439			},{440				"$name" : "item",441				"$text" : "",442				"label" : "卿æ¾ç¤ºåä½é¢è²",443				"psmCount" : "1",444				"url" : "$UI/demo/pcSample/text/changeColor.w"445			},{446				"$name" : "item",447				"$text" : "",448				"label" : "ææ¬æªå",449				"psmCount" : "1",450				"url" : "$UI/demo/pcSample/text/cutout.w"451			},{452				"$name" : "item",453				"$text" : "",454				"label" : "ç嬿æ¬è¾å
¥",455				"psmCount" : "1",456				"url" : "$UI/demo/pcSample/text/listeningTextChange.w"457			},{458				"$name" : "item",459				"$text" : "",460				"label" : "æ»å¨æå",461				"psmCount" : "1",462				"url" : "$UI/demo/pcSample/text/roll.w"463			}],464			"$name" : "item",465			"$text" : "",466			"label" : "text"467		},{468			"$children" : [{469				"$name" : "item",470				"$text" : "",471				"label" : "å表-æ æ ·å¼å表",472				"psmCount" : "1",473				"url" : "$UI/demo/pcSample/table/basic/basic.w"474			},{475				"$name" : "item",476				"$text" : "",477				"label" : "å表-åºæ¬ç¤ºä¾",478				"psmCount" : "1",479				"url" : "$UI/demo/pcSample/table/basic/basictwo.w"480			},{481				"$name" : "item",482				"$text" : "",483				"label" : "å表-å¤è¡ç¹å»åè²",484				"psmCount" : "1",485				"url" : "$UI/demo/pcSample/table/basic/basicthree.w"486			},{487				"$name" : "item",488				"$text" : "",489				"label" : "å表-radio模å¼",490				"psmCount" : "1",491				"url" : "$UI/demo/pcSample/table/basic/basicfour.w"492			},{493				"$name" : "item",494				"$text" : "",495				"label" : "å表-checkbox模å¼",496				"psmCount" : "1",497				"url" : "$UI/demo/pcSample/table/basic/basicfive.w"498			},{499				"$name" : "item",500				"$text" : "",501				"label" : "å表-ç¹å»è¡éä¸checkbox模å¼",502				"psmCount" : "1",503				"url" : "$UI/demo/pcSample/table/basic/basicsix.w"504			},{505				"$name" : "item",506				"$text" : "",507				"label" : "å表-æåºæ¨¡å¼",508				"psmCount" : "1",509				"url" : "$UI/demo/pcSample/table/basic/basicseven.w"510			},{511				"$name" : "item",512				"$text" : "",513				"label" : "å表-æ ¹æ®æåæ®µè®¾ç½®è¡æ ·å¼",514				"psmCount" : "1",515				"url" : "$UI/demo/pcSample/table/basic/basiceight.w"516			},{517				"$name" : "item",518				"$text" : "",519				"label" : "å表-æ ¹æ®å段设置æåé¢è²",520				"psmCount" : "1",521				"url" : "$UI/demo/pcSample/table/basic/basicnine.w"522			},{523				"$name" : "item",524				"$text" : "",525				"label" : "å表-è®¾ç½®å±æ§å¼æ§å¶è¡¨æ ¼æ ·å¼",526				"psmCount" : "1",527				"url" : "$UI/demo/pcSample/table/basic/basicten.w"528			},{529				"$name" : "item",530				"$text" : "",531				"label" : "å表-æåæè¡",532				"psmCount" : "1",533				"url" : "$UI/demo/pcSample/table/basic/basiceleven.w"534			},{535				"$name" : "item",536				"$text" : "",537				"label" : "表å-æ æ ·å¼è¡¨å",538				"psmCount" : "1",539				"url" : "$UI/demo/pcSample/table/basic/basictwelve.w"540			},{541				"$name" : "item",542				"$text" : "",543				"label" : "表å-坿¶ç¼©ç表å",544				"psmCount" : "1",545				"url" : "$UI/demo/pcSample/table/basic/basicthirteen.w"546			},{547				"$name" : "item",548				"$text" : "",549				"label" : "表å-formRow5Btn2表å",550				"psmCount" : "1",551				"url" : "$UI/demo/pcSample/table/basic/basicfourteen.w"552			},{553				"$name" : "item",554				"$text" : "",555				"label" : "表å-table表å",556				"psmCount" : "1",557				"url" : "$UI/demo/pcSample/table/basic/basicfifteen.w"558			},{559				"$name" : "item",560				"$text" : "",561				"label" : "表å-view模å¼è¡¨å",562				"psmCount" : "1",563				"url" : "$UI/demo/pcSample/table/basic/basicsixteen.w"564			},{565				"$name" : "item",566				"$text" : "",567				"label" : "åºæ¬è¡¨æ ¼æ¨¡æ¿",568				"psmCount" : "1",569				"url" : "$UI/demo/pcSample/table/tableTemplate/tableTemplate.w"570			},{571				"$name" : "item",572				"$text" : "",573				"label" : "嫿¨ªåæ»å¨æ¡",574				"psmCount" : "1",575				"url" : "$UI/demo/pcSample/table/scrollX/scrollX.w"576			},{577				"$name" : "item",578				"$text" : "",579				"label" : "å¼¹çªä¸ç表格",580				"psmCount" : "1",581				"url" : "$UI/demo/pcSample/table/widowsDialog/windowsDialog.w"582			},{583				"$name" : "item",584				"$text" : "",585				"label" : "è¡¨æ ¼å¨ææä½",586				"psmCount" : "1",587				"url" : "$UI/demo/pcSample/table/dynamicCreate/dynamicCreate.w"588			},{589				"$name" : "item",590				"$text" : "",591				"label" : "åå
æ ¼ä¿¡æ¯æç¤º",592				"psmCount" : "1",593				"url" : "$UI/demo/pcSample/table/informationHint/informationHint.w"594			},{595				"$name" : "item",596				"$text" : "",597				"label" : "ç¶å表格",598				"psmCount" : "1",599				"url" : "$UI/demo/pcSample/table/fatherAndSon/nestedTable.w"600			}],601			"$name" : "item",602			"$text" : "",603			"label" : "table"604		},{605			"$children" : [{606				"$name" : "item",607				"$text" : "",608				"label" : "åºæ¬æé®",609				"psmCount" : "1",610				"url" : "$UI/demo/pcSample/form-element/button.w"611			},{612				"$name" : "item",613				"$text" : "",614				"label" : "åéæé®",615				"psmCount" : "1",616				"url" : "$UI/demo/pcSample/form-element/radio.w"617			},{618				"$name" : "item",619				"$text" : "",620				"label" : "å¤éæé®",621				"psmCount" : "1",622				"url" : "$UI/demo/pcSample/form-element/checkBox.w"623			},{624				"$name" : "item",625				"$text" : "",626				"label" : "å¤éæé®",627				"psmCount" : "1",628				"url" : "$UI/demo/pcSample/form-element/checkBox.w"629			},{630				"$name" : "item",631				"$text" : "",632				"label" : "åé䏿æ¡",633				"psmCount" : "1",634				"url" : "$UI/demo/pcSample/form-element/select.w"635			},{636				"$name" : "item",637				"$text" : "",638				"label" : "æä»¶ä¸ä¼ ä¸è½½",639				"psmCount" : "1",640				"url" : "$UI/demo/pcSample/form-element/fileUploadDown.w"641			},{642				"$name" : "item",643				"$text" : "",644				"label" : "æä»¶æ¡ä»¶ä¸ä¼ ",645				"psmCount" : "1",646				"url" : "$UI/demo/pcSample/form-element/fileUploadDown.w"647			},{648				"$name" : "item",649				"$text" : "",650				"label" : "æ¡ä»¶è¿æ»¤å¨1",651				"psmCount" : "1",652				"url" : "$UI/demo/pcSample/form-element/filterConditionOne.w"653			},{654				"$name" : "item",655				"$text" : "",656				"label" : "æ¡ä»¶è¿æ»¤å¨2",657				"psmCount" : "1",658				"url" : "$UI/demo/pcSample/form-element/filterConditionTwo.w"659			},{660				"$name" : "item",661				"$text" : "",662				"label" : "æ¡ä»¶è¿æ»¤å¨3",663				"psmCount" : "1",664				"url" : "$UI/demo/pcSample/form-element/filterConditionThree.w"665			},{666				"$name" : "item",667				"$text" : "",668				"label" : "æ¡ä»¶è¿æ»¤å¨4",669				"psmCount" : "1",670				"url" : "$UI/demo/pcSample/form-element/filterConditionFour.w"671			},{672				"$name" : "item",673				"$text" : "",674				"label" : "æ¡ä»¶è¿æ»¤å¨5",675				"psmCount" : "1",676				"url" : "$UI/demo/pcSample/form-element/filterConditionFive.w"677			},{678				"$name" : "item",679				"$text" : "",680				"label" : "æ¡ä»¶è¿æ»¤å¨6",681				"psmCount" : "1",682				"url" : "$UI/demo/pcSample/form-element/filterConditionSix.w"683			},{684				"$name" : "item",685				"$text" : "",686				"label" : "æ¡ä»¶è¿æ»¤å¨7",687				"psmCount" : "1",688				"url" : "$UI/demo/pcSample/form-element/filterConditionSeven.w"689			},{690				"$name" : "item",691				"$text" : "",692				"label" : "æ¡ä»¶è¿æ»¤å¨8",693				"psmCount" : "1",694				"url" : "$UI/demo/pcSample/form-element/filterConditionEight.w"695			},{696				"$name" : "item",697				"$text" : "",698				"label" : "è¯æç级",699				"psmCount" : "1",700				"url" : "$UI/demo/pcSample/form-element/starComment.w"701			},{702				"$name" : "item",703				"$text" : "",704				"label" : "ææ¬æ¡",705				"psmCount" : "1",706				"url" : "$UI/demo/pcSample/form-element/text-box.w"707			},{708				"$name" : "item",709				"$text" : "",710				"label" : "ææ¬å",711				"psmCount" : "1",712				"url" : "$UI/demo/pcSample/form-element/textarea.w"713			}],714			"$name" : "item",715			"$text" : "",716			"label" : "form-element"717		},{718			"$children" : [{719				"$name" : "item",720				"$text" : "",721				"label" : "åºæ¬é项å¡-æµç¨",722				"psmCount" : "1",723				"url" : "$UI/demo/pcSample/navigator/basic-2.w"724			},{725				"$name" : "item",726				"$text" : "",727				"label" : "åºæ¬é项å¡-æ ·å¼2",728				"psmCount" : "1",729				"url" : "$UI/demo/pcSample/navigator/basic-flow.w"730			},{731				"$name" : "item",732				"$text" : "",733				"label" : "éææµç¨å¯¼èª",734				"psmCount" : "1",735				"url" : "$UI/demo/pcSample/navigator/basic-staticFlow.w"736			},{737				"$name" : "item",738				"$text" : "",739				"label" : "åºæ¬é项å¡",740				"psmCount" : "1",741				"url" : "$UI/demo/pcSample/navigator/Basic.w"742			},{743				"$name" : "item",744				"$text" : "",745				"label" : "æ°åå页æ§ä»¶",746				"psmCount" : "1",747				"url" : "$UI/demo/pcSample/navigator/digitalPaging.w"748			},{749				"$name" : "item",750				"$text" : "",751				"label" : "æ½å±å®¹å¨",752				"psmCount" : "1",753				"url" : "$UI/demo/pcSample/navigator/drawer.w"754			},{755				"$name" : "item",756				"$text" : "",757				"label" : "卿é项å¡",758				"psmCount" : "1",759				"url" : "$UI/demo/pcSample/navigator/dynamicTAB.w"760			},{761				"$name" : "item",762				"$text" : "",763				"label" : "åéæ¡ç»ä»¶",764				"psmCount" : "1",765				"url" : "$UI/demo/pcSample/navigator/gridLine.w"766			},{767				"$name" : "item",768				"$text" : "",769				"label" : "徿 å·¥å
·ç®±",770				"psmCount" : "1",771				"url" : "$UI/demo/pcSample/navigator/iconKit.w"772			},{773				"$name" : "item",774				"$text" : "",775				"label" : "徿 å¯¼èª",776				"psmCount" : "1",777				"url" : "$UI/demo/pcSample/navigator/iconNav.w"778			},{779				"$name" : "item",780				"$text" : "",781				"label" : "å¼¹åºèå",782				"psmCount" : "1",783				"url" : "$UI/demo/pcSample/navigator/popupMenu.w"784			},{785				"$name" : "item",786				"$text" : "",787				"label" : "徿 å·¥å
·æ ",788				"psmCount" : "1",789				"url" : "$UI/demo/pcSample/navigator/toolbar.w"790			}],791			"$name" : "item",792			"$text" : "",793			"label" : "navigator"794		},{795			"$children" : [{796				"$name" : "item",797				"$text" : "",798				"label" : "横å导èªï¼éææµç¨ï¼",799				"psmCount" : "1",800				"url" : "$UI/demo/pcSample/layout/cross_navigation_flow.w"801			},{802				"$name" : "item",803				"$text" : "",804				"label" : "横å导èªï¼æ»å¨ï¼",805				"psmCount" : "1",806				"url" : "$UI/demo/pcSample/layout/cross_navigation_slide.w"807			},{808				"$name" : "item",809				"$text" : "",810				"label" : "横å导èªï¼tabå«è¡¨æ ¼ï¼",811				"psmCount" : "1",812				"url" : "$UI/demo/pcSample/layout/cross_navigation_tab.w"813			},{814				"$name" : "item",815				"$text" : "",816				"label" : "横å导èª",817				"psmCount" : "1",818				"url" : "$UI/demo/pcSample/layout/cross_navigation1.w"819			},{820				"$name" : "item",821				"$text" : "",822				"label" : "横纵å导èª",823				"psmCount" : "1",824				"url" : "$UI/demo/pcSample/layout/cross_vertical.w"825			},{826				"$name" : "item",827				"$text" : "",828				"label" : "æ°æ®ç»´æ¤",829				"psmCount" : "1",830				"url" : "$UI/demo/pcSample/layout/dic_maintenance.w"831			},{832				"$name" : "item",833				"$text" : "",834				"label" : "åå
¸è¡¨ç»´æ¤",835				"psmCount" : "1",836				"url" : "$UI/demo/pcSample/layout/dictionary_maintenance.w"837			},{838				"$name" : "item",839				"$text" : "",840				"label" : "æç¤ºæ¨¡æ¿ï¼ç¨æ·å¡çï¼",841				"psmCount" : "1",842				"url" : "$UI/demo/pcSample/layout/hint_user_card.w"843			},{844				"$name" : "item",845				"$text" : "",846				"label" : "主页模æ¿ï¼ä¿¡æ¯æ ç®ä¸ï¼",847				"psmCount" : "1",848				"url" : "$UI/demo/pcSample/layout/homepage_information_tab1.w"849			},{850				"$name" : "item",851				"$text" : "",852				"label" : "主页模æ¿ï¼ä¿¡æ¯æ ç®äºï¼",853				"psmCount" : "1",854				"url" : "$UI/demo/pcSample/layout/homepage_information_tab2.w"855			},{856				"$name" : "item",857				"$text" : "",858				"label" : "主页模æ¿ï¼ä¹å®«æ ¼ï¼",859				"psmCount" : "1",860				"url" : "$UI/demo/pcSample/layout/homepage_Sudoku.w"861			},{862				"$name" : "item",863				"$text" : "",864				"label" : "å¤iframeï¼å±é¨æ»å¨ï¼",865				"psmCount" : "1",866				"url" : "$UI/demo/pcSample/layout/local_rolling.w"867			},{868				"$name" : "item",869				"$text" : "",870				"label" : "èµæºåé
ï¼æè§è²ï¼",871				"psmCount" : "1",872				"url" : "$UI/demo/pcSample/layout/resource_distribute_role.w"873			},{874				"$name" : "item",875				"$text" : "",876				"label" : "èµæºåé
ï¼æç¨æ·ï¼",877				"psmCount" : "1",878				"url" : "$UI/demo/pcSample/layout/resource_distribute_user.w"879			},{880				"$name" : "item",881				"$text" : "",882				"label" : "è§è²ç®¡ç",883				"psmCount" : "1",884				"url" : "$UI/demo/pcSample/layout/role_manage.w"885			},{886				"$name" : "item",887				"$text" : "",888				"label" : "ç¨æ·ç®¡ç",889				"psmCount" : "1",890				"url" : "$UI/demo/pcSample/layout/user_manage.w"891			},{892				"$name" : "item",893				"$text" : "",894				"label" : "å¾è¡¨ä¸è¡¨æ ¼",895				"psmCount" : "1",896				"url" : "$UI/demo/pcSample/layout/table_Echarts.w"897			},{898				"$name" : "item",899				"$text" : "",900				"label" : "纵å导èªï¼åç»å表ï¼",901				"psmCount" : "1",902				"url" : "$UI/demo/pcSample/layout/vertical_navigation_group.w"903			},{904				"$name" : "item",905				"$text" : "",906				"label" : "纵å导èªï¼é¾æ¥ï¼",907				"psmCount" : "1",908				"url" : "$UI/demo/pcSample/layout/vertical_navigation_link.w"909			},{910				"$name" : "item",911				"$text" : "",912				"label" : "纵å导èªï¼å表ï¼",913				"psmCount" : "1",914				"url" : "$UI/demo/pcSample/layout/vertical_navigation_list.w"915			},{916				"$name" : "item",917				"$text" : "",918				"label" : "纵å导èªï¼æ»å¨ï¼",919				"psmCount" : "1",920				"url" : "$UI/demo/pcSample/layout/vertical_navigation_slide.w"921			},{922				"$name" : "item",923				"$text" : "",924				"label" : "å¿«æ·æä½å导",925				"psmCount" : "1",926				"url" : "$UI/demo/pcSample/layout/vertical_tipwizard.w"927			}],928			"$name" : "item",929			"$text" : "",930			"label" : "layout"931		}],932		"$name" : "root",933		"$text" : ""934	};
...templates.js
Source:templates.js  
1/**2 * Default list of commands to execute for a PeerConnection test.3 */4const STABLE = "stable";5const HAVE_LOCAL_OFFER = "have-local-offer";6const HAVE_REMOTE_OFFER = "have-remote-offer";7const CLOSED = "closed";8const ICE_NEW = "new";9const GATH_NEW = "new";10const GATH_GATH = "gathering";11const GATH_COMPLETE = "complete"12function deltaSeconds(date1, date2) {13  return (date2.getTime() - date1.getTime())/1000;14}15function dumpSdp(test) {16  if (typeof test._local_offer !== 'undefined') {17    dump("ERROR: SDP offer: " + test._local_offer.sdp.replace(/[\r]/g, ''));18  }19  if (typeof test._remote_answer !== 'undefined') {20    dump("ERROR: SDP answer: " + test._remote_answer.sdp.replace(/[\r]/g, ''));21  }22  if ((test.pcLocal) && (typeof test.pcLocal._local_ice_candidates !== 'undefined')) {23    dump("pcLocal._local_ice_candidates: " + JSON.stringify(test.pcLocal._local_ice_candidates) + "\n");24    dump("pcLocal._remote_ice_candidates: " + JSON.stringify(test.pcLocal._remote_ice_candidates) + "\n");25    dump("pcLocal._ice_candidates_to_add: " + JSON.stringify(test.pcLocal._ice_candidates_to_add) + "\n");26  }27  if ((test.pcRemote) && (typeof test.pcRemote._local_ice_candidates !== 'undefined')) {28    dump("pcRemote._local_ice_candidates: " + JSON.stringify(test.pcRemote._local_ice_candidates) + "\n");29    dump("pcRemote._remote_ice_candidates: " + JSON.stringify(test.pcRemote._remote_ice_candidates) + "\n");30    dump("pcRemote._ice_candidates_to_add: " + JSON.stringify(test.pcRemote._ice_candidates_to_add) + "\n");31  }32  if ((test.pcLocal) && (typeof test.pcLocal.iceConnectionLog !== 'undefined')) {33    dump("pcLocal ICE connection state log: " + test.pcLocal.iceConnectionLog + "\n");34  }35  if ((test.pcRemote) && (typeof test.pcRemote.iceConnectionLog !== 'undefined')) {36    dump("pcRemote ICE connection state log: " + test.pcRemote.iceConnectionLog + "\n");37  }38  if ((test.pcLocal) && (test.pcRemote) &&39    (typeof test.pcLocal.setRemoteDescDate !== 'undefined') &&40    (typeof test.pcRemote.setLocalDescDate !== 'undefined')) {41    var delta = deltaSeconds(test.pcLocal.setRemoteDescDate, test.pcRemote.setLocalDescDate);42    dump("Delay between pcLocal.setRemote <-> pcRemote.setLocal: " + delta + "\n");43  }44  if ((test.pcLocal) && (test.pcRemote) &&45    (typeof test.pcLocal.setRemoteDescDate !== 'undefined') &&46    (typeof test.pcLocal.setRemoteDescStableEventDate !== 'undefined')) {47    var delta = deltaSeconds(test.pcLocal.setRemoteDescDate, test.pcLocal.setRemoteDescStableEventDate);48    dump("Delay between pcLocal.setRemote <-> pcLocal.signalingStateStable: " + delta + "\n");49  }50  if ((test.pcLocal) && (test.pcRemote) &&51    (typeof test.pcRemote.setLocalDescDate !== 'undefined') &&52    (typeof test.pcRemote.setLocalDescStableEventDate !== 'undefined')) {53    var delta = deltaSeconds(test.pcRemote.setLocalDescDate, test.pcRemote.setLocalDescStableEventDate);54    dump("Delay between pcRemote.setLocal <-> pcRemote.signalingStateStable: " + delta + "\n");55  }56}57function waitForIceConnected(test, pc) {58  if (!pc.iceCheckingRestartExpected) {59    if (pc.isIceConnected()) {60      info(pc + ": ICE connection state log: " + pc.iceConnectionLog);61      ok(true, pc + ": ICE is in connected state");62      return Promise.resolve();63    }64    if (!pc.isIceConnectionPending()) {65      dumpSdp(test);66      var details = pc + ": ICE is already in bad state: " + pc.iceConnectionState;67      ok(false, details);68      return Promise.reject(new Error(details));69    }70  }71  return pc.waitForIceConnected()72    .then(() => {73      info(pc + ": ICE connection state log: " + pc.iceConnectionLog);74      ok(pc.isIceConnected(), pc + ": ICE switched to 'connected' state");75    });76}77// We need to verify that at least one candidate has been (or will be) gathered.78function waitForAnIceCandidate(pc) {79  return new Promise(resolve => {80    if (!pc.localRequiresTrickleIce ||81        pc._local_ice_candidates.length > 0) {82      resolve();83    } else {84      // In some circumstances, especially when both PCs are on the same85      // browser, even though we are connected, the connection can be86      // established without receiving a single candidate from one or other87      // peer.  So we wait for at least one...88      pc._pc.addEventListener('icecandidate', resolve);89    }90  }).then(() => {91    ok(pc._local_ice_candidates.length > 0,92       pc + " received local trickle ICE candidates");93    isnot(pc._pc.iceGatheringState, GATH_NEW,94          pc + " ICE gathering state is not 'new'");95  });96}97function checkTrackStats(pc, rtpSenderOrReceiver, outbound) {98  var track = rtpSenderOrReceiver.track;99  var audio = (track.kind == "audio");100  var msg = pc + " stats " + (outbound ? "outbound " : "inbound ") +101      (audio ? "audio" : "video") + " rtp track id " + track.id;102  return pc.getStats(track).then(stats => {103    ok(pc.hasStat(stats, {104      type: outbound ? "outboundrtp" : "inboundrtp",105      isRemote: false,106      mediaType: audio ? "audio" : "video"107    }), msg + " - found expected stats");108    ok(!pc.hasStat(stats, {109      type: outbound ? "inboundrtp" : "outboundrtp",110      isRemote: false111    }), msg + " - did not find extra stats with wrong direction");112    ok(!pc.hasStat(stats, {113      mediaType: audio ? "video" : "audio"114    }), msg + " - did not find extra stats with wrong media type");115  });116}117var checkAllTrackStats = pc => {118  return Promise.all([].concat(119    pc._pc.getSenders().map(sender => checkTrackStats(pc, sender, true)),120    pc._pc.getReceivers().map(receiver => checkTrackStats(pc, receiver, false))));121}122// Commands run once at the beginning of each test, even when performing a123// renegotiation test.124var commandsPeerConnectionInitial = [125  function PC_SETUP_SIGNALING_CLIENT(test) {126    if (test.testOptions.steeplechase) {127      test.setupSignalingClient();128      test.registerSignalingCallback("ice_candidate", function (message) {129        var pc = test.pcRemote ? test.pcRemote : test.pcLocal;130        pc.storeOrAddIceCandidate(new RTCIceCandidate(message.ice_candidate));131      });132      test.registerSignalingCallback("end_of_trickle_ice", function (message) {133        test.signalingMessagesFinished();134      });135    }136  },137  function PC_LOCAL_SETUP_ICE_LOGGER(test) {138    test.pcLocal.logIceConnectionState();139  },140  function PC_REMOTE_SETUP_ICE_LOGGER(test) {141    test.pcRemote.logIceConnectionState();142  },143  function PC_LOCAL_SETUP_SIGNALING_LOGGER(test) {144    test.pcLocal.logSignalingState();145  },146  function PC_REMOTE_SETUP_SIGNALING_LOGGER(test) {147    test.pcRemote.logSignalingState();148  },149  function PC_LOCAL_SETUP_ADDSTREAM_HANDLER(test) {150    test.pcLocal.setupAddStreamEventHandler();151  },152  function PC_REMOTE_SETUP_ADDSTREAM_HANDLER(test) {153    test.pcRemote.setupAddStreamEventHandler();154  },155  function PC_LOCAL_CHECK_INITIAL_SIGNALINGSTATE(test) {156    is(test.pcLocal.signalingState, STABLE,157       "Initial local signalingState is 'stable'");158  },159  function PC_REMOTE_CHECK_INITIAL_SIGNALINGSTATE(test) {160    is(test.pcRemote.signalingState, STABLE,161       "Initial remote signalingState is 'stable'");162  },163  function PC_LOCAL_CHECK_INITIAL_ICE_STATE(test) {164    is(test.pcLocal.iceConnectionState, ICE_NEW,165       "Initial local ICE connection state is 'new'");166  },167  function PC_REMOTE_CHECK_INITIAL_ICE_STATE(test) {168    is(test.pcRemote.iceConnectionState, ICE_NEW,169       "Initial remote ICE connection state is 'new'");170  },171];172var commandsGetUserMedia = [173  function PC_LOCAL_GUM(test) {174    return test.pcLocal.getAllUserMedia(test.pcLocal.constraints);175  },176  function PC_REMOTE_GUM(test) {177    return test.pcRemote.getAllUserMedia(test.pcRemote.constraints);178  },179];180var commandsPeerConnectionOfferAnswer = [181  function PC_LOCAL_SETUP_ICE_HANDLER(test) {182    test.pcLocal.setupIceCandidateHandler(test);183  },184  function PC_REMOTE_SETUP_ICE_HANDLER(test) {185    test.pcRemote.setupIceCandidateHandler(test);186  },187  function PC_LOCAL_STEEPLECHASE_SIGNAL_EXPECTED_LOCAL_TRACKS(test) {188    if (test.testOptions.steeplechase) {189      send_message({"type": "local_expected_tracks",190                    "expected_tracks": test.pcLocal.expectedLocalTrackInfoById});191    }192  },193  function PC_REMOTE_STEEPLECHASE_SIGNAL_EXPECTED_LOCAL_TRACKS(test) {194    if (test.testOptions.steeplechase) {195      send_message({"type": "remote_expected_tracks",196                    "expected_tracks": test.pcRemote.expectedLocalTrackInfoById});197    }198  },199  function PC_LOCAL_GET_EXPECTED_REMOTE_TRACKS(test) {200    if (test.testOptions.steeplechase) {201      return test.getSignalingMessage("remote_expected_tracks").then(202          message => {203            test.pcLocal.expectedRemoteTrackInfoById = message.expected_tracks;204          });205    }206    // Deep copy, as similar to steeplechase as possible207    test.pcLocal.expectedRemoteTrackInfoById =208      JSON.parse(JSON.stringify(test.pcRemote.expectedLocalTrackInfoById));209  },210  function PC_REMOTE_GET_EXPECTED_REMOTE_TRACKS(test) {211    if (test.testOptions.steeplechase) {212      return test.getSignalingMessage("local_expected_tracks").then(213          message => {214            test.pcRemote.expectedRemoteTrackInfoById = message.expected_tracks;215          });216    }217    // Deep copy, as similar to steeplechase as possible218    test.pcRemote.expectedRemoteTrackInfoById =219      JSON.parse(JSON.stringify(test.pcLocal.expectedLocalTrackInfoById));220  },221  function PC_LOCAL_CREATE_OFFER(test) {222    return test.createOffer(test.pcLocal).then(offer => {223      is(test.pcLocal.signalingState, STABLE,224         "Local create offer does not change signaling state");225    });226  },227  function PC_LOCAL_STEEPLECHASE_SIGNAL_OFFER(test) {228    if (test.testOptions.steeplechase) {229      send_message({"type": "offer",230                    "offer": test.originalOffer,231                    "offer_constraints": test.pcLocal.constraints,232                    "offer_options": test.pcLocal.offerOptions});233      test._local_offer = test.originalOffer;234      test._offer_constraints = test.pcLocal.constraints;235      test._offer_options = test.pcLocal.offerOptions;236    }237  },238  function PC_LOCAL_SET_LOCAL_DESCRIPTION(test) {239    return test.setLocalDescription(test.pcLocal, test.originalOffer, HAVE_LOCAL_OFFER)240      .then(() => {241        is(test.pcLocal.signalingState, HAVE_LOCAL_OFFER,242           "signalingState after local setLocalDescription is 'have-local-offer'");243      });244  },245  function PC_REMOTE_GET_OFFER(test) {246    if (!test.testOptions.steeplechase) {247      test._local_offer = test.originalOffer;248      test._offer_constraints = test.pcLocal.constraints;249      test._offer_options = test.pcLocal.offerOptions;250      return Promise.resolve();251    }252    return test.getSignalingMessage("offer")253      .then(message => {254        ok("offer" in message, "Got an offer message");255        test._local_offer = new RTCSessionDescription(message.offer);256        test._offer_constraints = message.offer_constraints;257        test._offer_options = message.offer_options;258      });259  },260  function PC_REMOTE_SET_REMOTE_DESCRIPTION(test) {261    return test.setRemoteDescription(test.pcRemote, test._local_offer, HAVE_REMOTE_OFFER)262      .then(() => {263        is(test.pcRemote.signalingState, HAVE_REMOTE_OFFER,264           "signalingState after remote setRemoteDescription is 'have-remote-offer'");265      });266  },267  function PC_LOCAL_SANE_LOCAL_SDP(test) {268    test.pcLocal.localRequiresTrickleIce =269      sdputils.verifySdp(test._local_offer, "offer",270                         test._offer_constraints, test._offer_options,271                         test.testOptions);272  },273  function PC_REMOTE_SANE_REMOTE_SDP(test) {274    test.pcRemote.remoteRequiresTrickleIce =275      sdputils.verifySdp(test._local_offer, "offer",276                         test._offer_constraints, test._offer_options,277                         test.testOptions);278  },279  function PC_REMOTE_CREATE_ANSWER(test) {280    return test.createAnswer(test.pcRemote)281      .then(answer => {282        is(test.pcRemote.signalingState, HAVE_REMOTE_OFFER,283           "Remote createAnswer does not change signaling state");284        if (test.testOptions.steeplechase) {285          send_message({"type": "answer",286                        "answer": test.originalAnswer,287                        "answer_constraints": test.pcRemote.constraints});288          test._remote_answer = test.pcRemote._last_answer;289          test._answer_constraints = test.pcRemote.constraints;290        }291      });292  },293  function PC_REMOTE_SET_LOCAL_DESCRIPTION(test) {294    return test.setLocalDescription(test.pcRemote, test.originalAnswer, STABLE)295      .then(() => {296        is(test.pcRemote.signalingState, STABLE,297           "signalingState after remote setLocalDescription is 'stable'");298      });299  },300  function PC_LOCAL_GET_ANSWER(test) {301    if (!test.testOptions.steeplechase) {302      test._remote_answer = test.originalAnswer;303      test._answer_constraints = test.pcRemote.constraints;304      return Promise.resolve();305    }306    return test.getSignalingMessage("answer").then(message => {307      ok("answer" in message, "Got an answer message");308      test._remote_answer = new RTCSessionDescription(message.answer);309      test._answer_constraints = message.answer_constraints;310    });311  },312  function PC_LOCAL_SET_REMOTE_DESCRIPTION(test) {313    return test.setRemoteDescription(test.pcLocal, test._remote_answer, STABLE)314      .then(() => {315        is(test.pcLocal.signalingState, STABLE,316           "signalingState after local setRemoteDescription is 'stable'");317      });318  },319  function PC_REMOTE_SANE_LOCAL_SDP(test) {320    test.pcRemote.localRequiresTrickleIce =321      sdputils.verifySdp(test._remote_answer, "answer",322                         test._offer_constraints, test._offer_options,323                         test.testOptions);324  },325  function PC_LOCAL_SANE_REMOTE_SDP(test) {326    test.pcLocal.remoteRequiresTrickleIce =327      sdputils.verifySdp(test._remote_answer, "answer",328                         test._offer_constraints, test._offer_options,329                         test.testOptions);330  },331  function PC_LOCAL_WAIT_FOR_ICE_CONNECTED(test) {332    return waitForIceConnected(test, test.pcLocal);333  },334  function PC_REMOTE_WAIT_FOR_ICE_CONNECTED(test) {335    return waitForIceConnected(test, test.pcRemote);336  },337  function PC_LOCAL_VERIFY_ICE_GATHERING(test) {338    return waitForAnIceCandidate(test.pcLocal);339  },340  function PC_REMOTE_VERIFY_ICE_GATHERING(test) {341    return waitForAnIceCandidate(test.pcRemote);342  },343  function PC_LOCAL_CHECK_MEDIA_TRACKS(test) {344    return test.pcLocal.checkMediaTracks();345  },346  function PC_REMOTE_CHECK_MEDIA_TRACKS(test) {347    return test.pcRemote.checkMediaTracks();348  },349  function PC_LOCAL_WAIT_FOR_MEDIA_FLOW(test) {350    return test.pcLocal.waitForMediaFlow();351  },352  function PC_REMOTE_WAIT_FOR_MEDIA_FLOW(test) {353    return test.pcRemote.waitForMediaFlow();354  },355  function PC_LOCAL_CHECK_STATS(test) {356    return test.pcLocal.getStats().then(stats => {357      test.pcLocal.checkStats(stats, test.testOptions.steeplechase);358    });359  },360  function PC_REMOTE_CHECK_STATS(test) {361    return test.pcRemote.getStats().then(stats => {362      test.pcRemote.checkStats(stats, test.testOptions.steeplechase);363    });364  },365  function PC_LOCAL_CHECK_ICE_CONNECTION_TYPE(test) {366    return test.pcLocal.getStats().then(stats => {367      test.pcLocal.checkStatsIceConnectionType(stats);368    });369  },370  function PC_REMOTE_CHECK_ICE_CONNECTION_TYPE(test) {371    return test.pcRemote.getStats().then(stats => {372      test.pcRemote.checkStatsIceConnectionType(stats);373    });374  },375  function PC_LOCAL_CHECK_ICE_CONNECTIONS(test) {376    return test.pcLocal.getStats().then(stats => {377      test.pcLocal.checkStatsIceConnections(stats,378                                            test._offer_constraints,379                                            test._offer_options,380                                            test.testOptions);381    });382  },383  function PC_REMOTE_CHECK_ICE_CONNECTIONS(test) {384    return test.pcRemote.getStats().then(stats => {385      test.pcRemote.checkStatsIceConnections(stats,386                                             test._offer_constraints,387                                             test._offer_options,388                                             test.testOptions);389    });390  },391  function PC_LOCAL_CHECK_MSID(test) {392    return test.pcLocal.checkMsids();393  },394  function PC_REMOTE_CHECK_MSID(test) {395    return test.pcRemote.checkMsids();396  },397  function PC_LOCAL_CHECK_STATS(test) {398    return checkAllTrackStats(test.pcLocal);399  },400  function PC_REMOTE_CHECK_STATS(test) {401    return checkAllTrackStats(test.pcRemote);402  },403  function PC_LOCAL_VERIFY_SDP_AFTER_END_OF_TRICKLE(test) {404    if (test.pcLocal.endOfTrickleSdp) {405      /* In case the endOfTrickleSdp promise is resolved already it will win the406       * race because it gets evaluated first. But if endOfTrickleSdp is still407       * pending the rejection will win the race. */408      return Promise.race([409        test.pcLocal.endOfTrickleSdp,410        Promise.reject("No SDP")411      ])412      .then(sdp => sdputils.checkSdpAfterEndOfTrickle(sdp, test.testOptions, test.pcLocal.label),413            () => info("pcLocal: Gathering is not complete yet, skipping post-gathering SDP check"));414    }415  },416  function PC_REMOTE_VERIFY_SDP_AFTER_END_OF_TRICKLE(test) {417    if (test.pcRemote.endOfTrickelSdp) {418      /* In case the endOfTrickleSdp promise is resolved already it will win the419       * race because it gets evaluated first. But if endOfTrickleSdp is still420       * pending the rejection will win the race. */421      return Promise.race([422        test.pcRemote.endOfTrickleSdp,423        Promise.reject("No SDP")424      ])425      .then(sdp => sdputils.checkSdpAfterEndOfTrickle(sdp, test.testOptions, test.pcRemote.label),426            () => info("pcRemote: Gathering is not complete yet, skipping post-gathering SDP check"));427    }428  }429];430function PC_LOCAL_REMOVE_VP8_FROM_OFFER(test) {431  isnot(test.originalOffer.sdp.search("H264/90000"), -1, "H.264 should be present in the SDP offer");432  test.originalOffer.sdp = sdputils.removeVP8(test.originalOffer.sdp);433  info("Updated H264 only offer: " + JSON.stringify(test.originalOffer));434};435function PC_LOCAL_REMOVE_BUNDLE_FROM_OFFER(test) {436  test.originalOffer.sdp = sdputils.removeBundle(test.originalOffer.sdp);437  info("Updated no bundle offer: " + JSON.stringify(test.originalOffer));438};439function PC_LOCAL_REMOVE_RTCPMUX_FROM_OFFER(test) {440  test.originalOffer.sdp = sdputils.removeRtcpMux(test.originalOffer.sdp);441  info("Updated no RTCP-Mux offer: " + JSON.stringify(test.originalOffer));442};443var addRenegotiation = (chain, commands, checks) => {444  chain.append(commands);445  chain.append(commandsPeerConnectionOfferAnswer);446  if (checks) {447    chain.append(checks);448  }449};450var addRenegotiationAnswerer = (chain, commands, checks) => {451  chain.append(function SWAP_PC_LOCAL_PC_REMOTE(test) {452    var temp = test.pcLocal;453    test.pcLocal = test.pcRemote;454    test.pcRemote = temp;455  });456  addRenegotiation(chain, commands, checks);...Position.js
Source:Position.js  
1/**2 * å¤çæ£åç§»å¨3 */4(function(){5	var Position = window.Position = function(){6		7	}8	// 妿bDel为falseï¼åå°æ£åpcæ·»å è¿æ£å±ä¸çsqä½ç½®ï¼å¦æbDel为trueï¼åå é¤sqä½ç½®çæ£åã9	Position.prototype.addPiece = function(sq,pc,bDel) {10		this.squares[sq] = bDel ? 0 : pc;11		//æ´æ°çº¢æ¹å黿¹çåå¼12		if(pc < 16){13			var pcAdjust = pc - 8;14			this.vlWhite += bDel ? -PIECE_VALUE[pcAdjust][sq] : PIECE_VALUE[pcAdjust][sq];15		} else {16			var pcAdjust = pc - 16;17			this.vlBlack += bDel ? -PIECE_VALUE[pcAdjust][SQUARE_FLIP(sq)] : PIECE_VALUE[pcAdjust][SQUARE_FLIP(sq)];18		}19	}20	//å°è¯èµ°æ£21	Position.prototype.makeMove = function(mv){22		this.movePiece(mv);23		if(this.checked()){24			this.undoMovePiece();25			return false;26		}27		this.changeSide();28		this.distance ++;29		return true;30	}31	//åæ¶å°è¯èµ°çæ£32	Position.prototype.undoMakeMove = function(){33		this.changeSide();34		this.distance --;35		this.undoMovePiece();36		37	}38	//ç§»å¨æ£å39	Position.prototype.movePiece = function(mv){40		var sqSrc = SRC(mv);41		var pcSrc = this.squares[sqSrc];42		var sqDst = DST(mv);43		var pcDst = this.squares[sqDst];44		this.pcList.push(pcDst); //è®°å½è¢«åæçå (没æååæ¶ï¼è®°å½ 0);45		if (pcDst > 0) {46		  // ç»ç¹ææ£åï¼éè¦å é¤è¯¥æ£å47		  this.addPiece(sqDst, pcDst, DEL_PIECE);48		}49		//å é¤èµ·ç¹ä½ç½®æ£å50		this.addPiece(sqSrc,pcSrc,DEL_PIECE);51		//å°èµ·ç¹ä½ç½®çæ£åæ·»å å°ç»ç¹ä½ç½®52		this.addPiece(sqDst,pcSrc,ADD_PIECE);53		/*console.log("movePieceï¼" + "黿£--" + this.vlBlack + "红æ£--" + this.vlWhite);*/54		//è®°å½èµ°æ³55		this.mvList.push(mv);56	}57	//åæ¶ç§»å¨æ£å58	Position.prototype.undoMovePiece = function(){59		//ä»èµ°æ³è¡¨ä¸ååºæåä¸ä¸ªèµ°æ³60		var mv = this.mvList.pop();61		//è·åèµ°æ³çèµ·ç¹ï¼ç»ç¹ï¼æ£å62		var sqSrc = SRC(mv);63		var sqDst = DST(mv);64		var pcDst = this.squares[sqDst];65		// å é¤ç»ç¹æ£å66		this.addPiece(sqDst, pcDst, DEL_PIECE);	67		//å°è¿ä¸ªæ£åæ·»å å°èµ·ç¹68		this.addPiece(sqSrc,pcDst,ADD_PIECE);69		//ååºåæçå70		var pc = this.pcList.pop();71		if(pc > 0){72			this.addPiece(sqDst,pc,ADD_PIECE);73		}74		/*console.log("undomovePieceï¼" + "黿£--" + this.vlBlack + "红æ£--" + this.vlWhite);*/75	}76	//è·å¾åæ°77	Position.prototype.evaluate = function(){78		return this.sdPlayer == PLAYER ? (this.vlWhite - this.vlBlack) : (this.vlBlack - this.vlWhite);79	}80	//æ¹åèµ°æ£æ¹81	Position.prototype.changeSide = function(){82		this.sdPlayer = 1 - this.sdPlayer;83	}84	//夿èå°æ¯å¦è¢«æ»å»85	Position.prototype.checked = function(){86		var pcSelfSide = SIDE_TAG(this.sdPlayer);87		var pcOppSide = OPP_SIDE_TAG(this.sdPlayer);88		for(var sq = 0 ; sq < 256 ; sq ++){89			if(this.squares[sq] - pcSelfSide != PIECE_KING){90				continue;91			}92			//对æ¹è¿å
µæ¶ï¼æ¯å¦è½åå°ææ¹çå¸
93			if(this.squares[SQUARE_FORWARD(sq,this.sdPlayer)] == pcOppSide + PIECE_PAWN){94				return true;95			}96			//对æ¹å¹³å
µæ¶ï¼æ¯å¦è½åå°ææ¹çå¸
97			if(this.squares[sq - 1] == pcOppSide + PIECE_PAWN || this.squares[sq + 1] == pcOppSide + PIECE_PAWN){98				return true;99			}100			//对æ¹ç马è½å¦åå°ææ¹çå¸
101			for(var i = 0 ; i < 4 ; i ++){102				//马èä½ç½®103				var sqPin = sq + ADVISOR_DELTA[i];104				//马èä½ç½®å卿£å105				if(this.squares[sqPin] != 0){106					continue;107				}108				for (var j = 0; j < 2; j ++) {109				  var pcDst = this.squares[sq + KNIGHT_CHECK_DELTA[i][j]];110				  if (pcDst == pcOppSide + PIECE_KNIGHT) {111				    return true;112				  }113				} 114			}115			//对æ¹çç®ã车æ¯å¦è½åå°ææ¹çå¸
,æè
å°å¸
对è¸116			for(var i = 0 ; i < 4 ; i ++){117				var delta = KING_DELTA[i];118				var sqDst = sq + delta;119				while(IN_BOARD(sqDst)){120					var pcDst = this.squares[sqDst];121					//éå°äºæ£å122					if(pcDst > 0){123						//妿æ£åæ¯è½¦æè
对æ¹çå¸
ï¼åè¿åtrue124						if(pcDst == pcOppSide + PIECE_ROOK || pcDst == pcOppSide + PIECE_KING){125							return true;126						}127						break;128					}129					sqDst += delta;130				}131				//æ¤æ¶è¥æ£åè¿å¨æ£çå
ï¼å该ä½ç½®ä¸ºå
¶å®æ£å132				sqDst += delta;133				while(IN_BOARD(sqDst)){134					var pcDst = this.squares[sqDst];135					if(pcDst > 0){136						//æ¤æ¶æ£å为对æ¹çç®ï¼åå¯ä»¥è¢«å°å137						if(pcDst == pcOppSide + PIECE_CANNON){138							return true;139						}140						//æ è®ºæ¯å¦æ¯å¯¹æ¹çç®ï¼æ¤æ¶é½è¯¥éåºå¾ªç¯141						break;142					}143					sqDst += delta;144				}145			}146			return false;147		}148		return false;149	}150	//夿å½åå±é¢æ¯å¦ä¼å¯¼è´è¢«å°æ»151	Position.prototype.isMate = function(){152		var mvs = gen(this.squares);153		//å°è¯ææçæ¥éª¤ï¼å¦ææ¯ä¸æ¥é½ä¼è¢«å°åï¼é£ä¹è¯´æå·²ç»è¢«å°æ»äº154		for(var i = 0 , len = mvs.length ; i < len ; i ++){155			var mv = mvs[i];156			if(this.makeMove(mv)){157				this.undoMakeMove();158				return false;159			}160		}161		return true;162	}163	//ææ£åæ°164	Position.prototype.mateValue = function(){165		return this.distance - MATE_VALUE;166	}167	//è·ååå²è¡¨çææ 168	Position.prototype.historyIndex = function(mv){169		return ((this.squares[SRC(mv)] - 8) << 8) + DST(mv);170	}171	//å¤æèµ°æ³æ¯å¦åæ³172	Position.prototype.legalMove = function(mv){173		var sqSrc = SRC(mv);174		var pcSrc = this.squares[sqSrc];175		var pcSelfSide = SIDE_TAG(this.sdPlayer);176		//å¦æèµ·ç¹ä¸ºå¯¹æ¹æ£åï¼æè
为空åï¼ä¸åæ³177		if((pcSrc & pcSelfSide) == 0){178			return false;179		}180		var sqDst = DST(mv);181		var pcDst = this.squares[sqDst];182		//ç»ç¹ä½ç½®æ£åä¸ºææ¹æ£å183		if((pcDst & pcSelfSide) != 0){184			return false;185		}186		//æ ¹æ®æ£åç±»å夿187		switch(pcSrc - pcSelfSide){188			case PIECE_KING: //å°(å¸
)189				return IN_FORT(sqDst) && KING_SPAN(sqSrc,sqDst);190			case PIECE_ADVISOR: //士191				return IN_FORT(sqDst) && ADVISOR_SPAN(sqSrc,sqDst);192			case PIECE_BISHOP: //象193				return SAME_HALF(sqSrc,sqDst) && BISHOP_SPAN(sqSrc,sqDst) 194					&& this.squares[BISHOP_PIN(sqSrc,sqDst)] == 0;195			case PIECE_KNIGHT: //马196				var sqPin = KNIGHT_SPAN(sqSrc,sqDst);197				return sqPin != sqSrc && this.squares[sqPin] == 0;198			case PIECE_ROOK: //车199			case PIECE_CANNON: //ç®200				//车ä¸ç®åæ¯ç´çº¿èµ°è·¯ï¼å¤ææ¯å¦æ¯åä¸è¡æè
åä¸å201				var delta;//ç§»å¨åé202				//åä¸è¡ 203				if(SAME_RANK(sqSrc,sqDst)){204					delta = sqDst > sqSrc ? 1 : -1;205				} else if(SAME_FILE(sqSrc,sqDst)){206					delta = sqDst > sqSrc ? 16 : -16;207				} else {208					return false;209				}210				var sqPin = sqSrc + delta;211				//沿çç»ç¹çæ¹ååè¿ï¼ç´å°å°è¾¾ç»ç¹æè
éå°äºå
¶å®æ£åä½ç½®212				while(sqPin != sqDst && this.squares[sqPin] == 0){213					sqPin += delta;214				}215				//å¦ææ¤æ¶å°è¾¾äºç»ç¹ï¼è¯´æä¸é没æéå°ä¸ä¸ªæ£åï¼æ¤æ¶è¥ç»ç¹ä¸ºç©ºï¼å车æç®é½åæ³ï¼å¦ååªæè½¦åæ³216				if(sqPin == sqDst){217					return this.squares[sqDst] == 0 || pcSrc - pcSelfSide == PIECE_ROOK;218				}219				//没æå°è¾¾ç»ç¹ï¼æ¤æ¶sqPin对åºçä½ç½®æ£åä¸ä¸ºç©º,æ¤æ¶å¦ææ¯è½¦ï¼åä¸åæ³ï¼å¦æç»ç¹ä¸ºç©ºï¼ä¹ä¸åæ³220				if(pcDst == 0 || pcSrc - pcSelfSide != PIECE_CANNON){221					return false;222				}223				sqPin += delta;224				while(sqPin != sqDst && this.squares[sqPin] == 0){225					sqPin += delta;226				}227				//æ¤æ¶åæ¬¡ç¢°å°æ£åï¼å¦æè¯¥ä½ç½®æ¯ç»ç¹ï¼åç®åæ³ï¼å¦åé½ä¸åæ³228				return sqPin == sqDst;229			case PIECE_PAWN: //å
µ(å)230				//妿已ç»è¿æ²³ï¼ä¸æ¯åå·¦åå³èµ°çï¼åæ³231				if(AWAY_HALF(sqSrc,this.sdPlayer) && 232					(sqDst - sqSrc == 1 || sqDst - sqSrc == -1)){233					return true;234				}235				var sqPin = SQUARE_FORWARD(sqSrc,this.sdPlayer);236				return sqPin == sqDst;237			default:238				return false;239		}240	}241	Position.prototype.clearBoard = function() {242		//å¼å§èµ°æ£æ¹243		this.sdPlayer = game.sm.whoIsFirst;244		this.squares = []; //æ£çæ°ç»245		for(var i = 0 ; i < 256 ; i++){246			this.squares.push(0);247		}248		this.vlWhite = this.vlBlack = 0;249	};250	Position.prototype.setIrrev = function(){251		//èµ°æ³æ°ç»ï¼å卿¯æ¬¡çèµ°æ³252		this.mvList = [0];253		//ååæ°ç»ï¼åæ¾æ¯æ¬¡åå254		this.pcList = [0];255		//深度ï¼ä»£è¡¨æ¯æ¬¡æç´¢æ¶è¿è¡ç深度ï¼é
ååå²è¡¨ä½¿ç¨256		this.distance = 0;257	}258	//è§£æfen259	Position.prototype.fromFen = function(fen){260		this.clearBoard();261		var index = 0;262		if(index == fen.length){263			return ;264		}265		var c = fen.charAt(index);266		var x = 3,y = 3;//x 代表å y 代表è¡267		while(c != " "){268			if(c == "/"){//æ¢è¡269				x = 3;270				y ++;271			} else if(c >= 1 && c <= 9){ // 空格272				x += (c.charCodeAt() - ("0").charCodeAt());273			} else if(c >= "A" && c <= "Z"){274				if(x <= 11){275					var pt = CHAR_TO_PIECE(c);276					if(pt >= 0){277						this.addPiece(COORD_XY(x,y),pt + 8,ADD_PIECE);278					}279					x ++;280				}281			} else if(c >= "a" && c <= "z"){282				if(x <= 11){283					var pt = CHAR_TO_PIECE(c.toUpperCase());284					if(pt >= 0){285						this.addPiece(COORD_XY(x,y),pt + 16,ADD_PIECE);286					}287					x ++;288				}289			}290			index++;291			if(index == fen.length){292				this.setIrrev();293				return ;294			}295			c = fen.charAt(index);			296		}297		this.setIrrev();298		console.log("é»ååæ°ï¼" + this.vlBlack + " 红ååæ°:" + this.vlWhite);299	}...Using AI Code Generation
1var wpt = require('webpagetest');2var util = require('util');3var fs = require('fs');4var wpt = new WebPageTest('www.webpagetest.org');5var wpt = new WebPageTest('www.webpagetest.org');6var options = {7    videoParams: {8    }9};Using AI Code Generation
1var wptools = require('wptools');2var page = wptools.page('Albert Einstein');3page.get(function(err, resp) {4  console.log(resp);5});6var wptools = require('wptools');7var page = wptools.page('Albert Einstein');8page.get(function(err, resp) {9  console.log(resp);10});Using AI Code Generation
1var wpt = require('./wpt.js');2var wpt = new WebPageTest('www.webpagetest.org');3    if (err) {4        console.log(err);5    } else {6        console.log(data);7    }8});9var WebPageTest = function(server, apiKey) {10    this.server = server;11    this.apiKey = apiKey;12    this.timeout = 60000;13    this.pollResults = 5000;14    this.pollRun = 5000;15    this.pollTesters = 5000;16    this.pollLocations = 5000;17    this.apiKeyParam = (this.apiKey) ? '&k=' + this.apiKey : '';18    this.apiKeyParam = (this.apiKey) ? '?k=' + this.apiKey : '';19};20WebPageTest.prototype.runTest = function(url, callback, options) {21    var self = this;22    var options = options || {};23    var location = options.location || 'Dulles:Chrome';24    var connectivity = options.connectivity || 'Cable';25    var bwDown = options.bwDown || 1000;26    var bwUp = options.bwUp || 1000;27    var latency = options.latency || 0;28    var plr = options.plr || 0;29    var ping = options.ping || 0;30    var mobile = options.mobile || 0;31    var fvonly = options.fvonly || 0;32    var video = options.video || 0;33    var timeline = options.timeline || 0;34    var netlog = options.netlog || 0;35    var noscript = options.noscript || 0;36    var noimages = options.noimages || 0;37    var blockads = options.blockads || 0;38    var standard = options.standard || 0;39    var script = options.script || '';40    var script = (script != '') ? '&script=' + script : '';41    var label = options.label || '';42    var label = (label != '') ? '&label=' + label : '';43    var runs = options.runs || 1;44    var fvonly = options.fvonly || 0;45    var notify = options.notify || '';46    var notify = (notify != '') ? '¬ify=' + notify : '';Using AI Code Generation
1wpt.pc('test', 'test');2wpt.pc('test', 'test', function(error, data) {3    if (error) {4        console.log(error);5    } else {6        console.log(data);7    }8});9wpt.pc('test', 'test', {10});11wpt.pc('test', 'test', {12}, function(error, data) {13    if (error) {14        console.log(error);15    } else {16        console.log(data);17    }18});19wpt.getLocations();20wpt.getLocations(function(error, data) {21    if (error) {22        console.log(error);23    } else {24        console.log(data);25    }26});27wpt.getTestQueue();28wpt.getTestQueue(function(error, data) {29    if (error) {30        console.log(error);31    } else {32        console.log(data);33    }34});35wpt.getTestHistory();36wpt.getTestHistory(function(error, data) {37    if (error) {38        console.log(error);39    } else {40        console.log(data);41    }42});43wpt.getTestHistoryForLocation('test');44wpt.getTestHistoryForLocation('testLearn 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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
