1#!/usr/bin/env python3 2# -*- coding: utf-8 -*- 3""" 4Copyright (c) 2024 Huawei Device Co., Ltd. 5Licensed under the Apache License, Version 2.0 (the "License"); 6you may not use this file except in compliance with the License. 7You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11Unless required by applicable law or agreed to in writing, software 12distributed under the License is distributed on an "AS IS" BASIS, 13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14See the License for the specific language governing permissions and 15limitations under the License. 16 17Description: Scenario test case. 18""" 19 20import logging 21import os 22import time 23 24import pytest 25 26from aw import Application 27from aw import Utils 28from aw import debugger 29from aw.api import debugger_api, runtime_api 30 31 32@pytest.mark.debug 33@pytest.mark.timeout(80) 34class TestWorkerDropFrame01: 35 """ 36 测试用例:多线程 debug 调试之 drop frame 37 测试步骤: 38 1. 连接 connect server 和主线程 debugger server 39 2. 主线程使能 Runtime 和 Debugger 40 3. 主线程 resume(Debugger.resume) 41 4. 触发点击事件,创建子线程,连接子线程 debugger server 42 5. 子线程使能 Runtime 和 Debugger 43 6. 子线程 Worker.ets 文件设置断点(Debugger.getPossibleAndSetBreakpointByUrl) 44 7. 子线程 resume,停在断点处(Debugger.resume) 45 8. 子线程 evaluateOnCallFrame,观察指定变量的值(Debugger.evaluateOnCallFrame) 46 9. 子线程时光调试,回到方法调用前(Debugger.dropFrame) 47 10. 子线程 evaluateOnCallFrame,观察指定变量的值是否变化(Debugger.evaluateOnCallFrame) 48 11. 子线程重复步骤 6-10,测试 dropFrame 在不同方法内的执行情况 49 12. 所有线程去使能 debugger(Debugger.disable) 50 13. 关闭所有线程 debugger server 和 connect server 连接 51 """ 52 53 def setup_method(self): 54 logging.info('Start running TestWorkerDropFrame01: setup') 55 56 self.log_path = rf'{os.path.dirname(__file__)}\..\log' 57 self.hilog_file_name = 'test_worker_drop_frame_01.hilog.txt' 58 self.id_generator = Utils.message_id_generator() 59 60 # receive the hilog before the test start 61 Utils.clear_fault_log() 62 self.hilog_process, self.write_thread = Utils.save_hilog(log_path=self.log_path, 63 file_name=self.hilog_file_name, 64 debug_on=True) 65 66 def teardown_method(self): 67 Application.uninstall(self.config['bundle_name']) 68 69 # terminate the hilog receive process after the test done 70 time.sleep(3) 71 self.hilog_process.stdout.close() 72 self.hilog_process.terminate() 73 self.hilog_process.wait() 74 self.write_thread.join() 75 76 Utils.save_fault_log(log_path=self.log_path) 77 logging.info('TestWorkerDropFrame01 done') 78 79 def test(self, test_suite_worker_08_debug): 80 logging.info('Start running TestWorkerDropFrame01: test') 81 self.config = test_suite_worker_08_debug 82 websocket = self.config['websocket'] 83 taskpool = self.config['taskpool'] 84 pid = self.config['pid'] 85 self.debugger_impl = debugger_api.DebuggerImpl(self.id_generator, websocket) 86 self.runtime_impl = runtime_api.RuntimeImpl(self.id_generator, websocket) 87 88 taskpool.submit(websocket.main_task(taskpool, self.procedure, pid)) 89 taskpool.await_taskpool() 90 taskpool.task_join() 91 if taskpool.task_exception: 92 raise taskpool.task_exception 93 94 async def procedure(self, websocket): 95 ################################################################################################################ 96 # main thread: connect the debugger server 97 ################################################################################################################ 98 main_thread = await self.debugger_impl.connect_to_debugger_server(self.config['pid'], True) 99 logging.info(f'Connect to the debugger server of instance: {main_thread.instance_id}') 100 ################################################################################################################ 101 # main thread: Runtime.enable 102 ################################################################################################################ 103 await self.runtime_impl.send("Runtime.enable", main_thread) 104 ################################################################################################################ 105 # main thread: Debugger.enable 106 ################################################################################################################ 107 await self.debugger_impl.send("Debugger.enable", main_thread) 108 ################################################################################################################ 109 # main thread: Runtime.runIfWaitingForDebugger 110 ################################################################################################################ 111 await self.runtime_impl.send("Runtime.runIfWaitingForDebugger", main_thread) 112 ################################################################################################################ 113 # main thread: Debugger.scriptParsed 114 ################################################################################################################ 115 response = await self.debugger_impl.recv("Debugger.scriptParsed", main_thread) 116 assert response['params']['url'] == self.config['file_path']['entry_ability'] 117 assert response['params']['endLine'] == 0 118 ################################################################################################################ 119 # main thread: Debugger.paused 120 ################################################################################################################ 121 response = await self.debugger_impl.recv("Debugger.paused", main_thread) 122 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['entry_ability'] 123 assert response['params']['reason'] == 'Break on start' 124 ################################################################################################################ 125 # main thread: Debugger.resume 126 ################################################################################################################ 127 await self.debugger_impl.send("Debugger.resume", main_thread) 128 ################################################################################################################ 129 # main thread: Debugger.scriptParsed 130 ################################################################################################################ 131 response = await self.debugger_impl.recv("Debugger.scriptParsed", main_thread) 132 assert response['params']['url'] == self.config['file_path']['index'] 133 assert response['params']['endLine'] == 0 134 ################################################################################################################ 135 # main thread: Debugger.paused 136 ################################################################################################################ 137 response = await self.debugger_impl.recv("Debugger.paused", main_thread) 138 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['index'] 139 assert response['params']['reason'] == 'Break on start' 140 ################################################################################################################ 141 # main thread: Debugger.resume 142 ################################################################################################################ 143 await self.debugger_impl.send("Debugger.resume", main_thread) 144 ################################################################################################################ 145 # main thread: click on the screen 146 ################################################################################################################ 147 Application.click_on_middle() 148 ################################################################################################################ 149 # worker thread: connect the debugger server 150 ################################################################################################################ 151 worker_thread = await self.debugger_impl.connect_to_debugger_server(self.config['pid'], False) 152 logging.info(f'Connect to the debugger server of instance: {worker_thread.instance_id}') 153 ################################################################################################################ 154 # worker thread: Runtime.enable 155 ################################################################################################################ 156 await self.runtime_impl.send("Runtime.enable", worker_thread) 157 ################################################################################################################ 158 # worker thread: Debugger.enable 159 ################################################################################################################ 160 await self.debugger_impl.send("Debugger.enable", worker_thread) 161 ################################################################################################################ 162 # worker thread: Runtime.runIfWaitingForDebugger 163 ################################################################################################################ 164 await self.runtime_impl.send("Runtime.runIfWaitingForDebugger", worker_thread) 165 ################################################################################################################ 166 # worker thread: Debugger.scriptParsed 167 ################################################################################################################ 168 response = await self.debugger_impl.recv("Debugger.scriptParsed", worker_thread) 169 assert response['params']['url'] == self.config['file_path']['worker'] 170 assert response['params']['endLine'] == 0 171 # worker thread: Debugger.paused 172 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 173 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 174 assert response['params']['reason'] == 'Break on start' 175 ################################################################################################################ 176 # worker thread: Debugger.removeBreakpointsByUrl 177 ################################################################################################################ 178 params = debugger.RemoveBreakpointsUrl(self.config['file_path']['worker']) 179 await self.debugger_impl.send("Debugger.removeBreakpointsByUrl", worker_thread, params) 180 ################################################################################################################ 181 # worker thread: Debugger.getPossibleAndSetBreakpointByUrl 182 ################################################################################################################ 183 locations = [debugger.BreakLocationUrl(url=self.config['file_path']['worker'], line_number=64)] 184 params = debugger.SetBreakpointsLocations(locations) 185 response = await self.debugger_impl.send("Debugger.getPossibleAndSetBreakpointsByUrl", 186 worker_thread, params) 187 assert response['result']['locations'][0]['id'] == 'id:64:0:' + self.config['file_path']['worker'] 188 ################################################################################################################ 189 # worker thread: Debugger.resume 190 ################################################################################################################ 191 await self.debugger_impl.send("Debugger.resume", worker_thread) 192 # worker thread: Debugger.paused 193 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 194 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 195 assert response['params']['reason'] == 'other' 196 assert response['params']['hitBreakpoints'] == ['id:64:9:' + self.config['file_path']['worker']] 197 ################################################################################################################ 198 # worker thread: Debugger.evaluateOnCallFrame 199 ################################################################################################################ 200 params = debugger.EvaluateOnCallFrameParams('b') 201 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 202 assert response['result']['result'] == {"type": "number", "unserializableValue": "3", "description": "3"} 203 params = debugger.EvaluateOnCallFrameParams('c') 204 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 205 assert response['result']['result'] == {"type": "number", "unserializableValue": "4", "description": "4"} 206 params = debugger.EvaluateOnCallFrameParams('e') 207 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 208 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 209 ################################################################################################################ 210 # worker thread: Debugger.dropFrame 211 ################################################################################################################ 212 params = debugger.DropFrameParams() 213 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 214 # worker thread: Debugger.paused 215 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 216 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 217 assert response['params']['reason'] == 'other' 218 assert response['params']['hitBreakpoints'] == [] 219 ################################################################################################################ 220 # worker thread: Debugger.evaluateOnCallFrame 221 ################################################################################################################ 222 params = debugger.EvaluateOnCallFrameParams('b') 223 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 224 assert response['result']['result'] == {"type": "number", "unserializableValue": "3", "description": "3"} 225 params = debugger.EvaluateOnCallFrameParams('c') 226 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 227 assert response['result']['result'] == {"type": "number", "unserializableValue": "0", "description": "0"} 228 params = debugger.EvaluateOnCallFrameParams('e') 229 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 230 assert response['result']['result'] == {"type": "number", "unserializableValue": "0", "description": "0"} 231 ################################################################################################################ 232 # worker thread: Debugger.dropFrame 233 ################################################################################################################ 234 params = debugger.DropFrameParams() 235 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 236 # worker thread: Debugger.paused 237 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 238 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 239 assert response['params']['reason'] == 'other' 240 assert response['params']['hitBreakpoints'] == [] 241 ################################################################################################################ 242 # worker thread: Debugger.evaluateOnCallFrame 243 ################################################################################################################ 244 params = debugger.EvaluateOnCallFrameParams('b') 245 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 246 assert response['result']['result'] == {"type": "number", "unserializableValue": "0", "description": "0"} 247 params = debugger.EvaluateOnCallFrameParams('c') 248 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 249 assert response['result']['result'] == {"type": "number", "unserializableValue": "0", "description": "0"} 250 params = debugger.EvaluateOnCallFrameParams('e') 251 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 252 assert response['result']['result']['type'] == "undefined" 253 ################################################################################################################ 254 # worker thread: Debugger.removeBreakpointsByUrl 255 ################################################################################################################ 256 params = debugger.RemoveBreakpointsUrl(self.config['file_path']['worker']) 257 await self.debugger_impl.send("Debugger.removeBreakpointsByUrl", worker_thread, params) 258 ################################################################################################################ 259 # worker thread: Debugger.getPossibleAndSetBreakpointByUrl 260 ################################################################################################################ 261 locations = [debugger.BreakLocationUrl(url=self.config['file_path']['worker'], line_number=76)] 262 params = debugger.SetBreakpointsLocations(locations) 263 response = await self.debugger_impl.send("Debugger.getPossibleAndSetBreakpointsByUrl", 264 worker_thread, params) 265 assert response['result']['locations'][0]['id'] == 'id:76:0:' + self.config['file_path']['worker'] 266 ################################################################################################################ 267 # worker thread: Debugger.resume 268 ################################################################################################################ 269 await self.debugger_impl.send("Debugger.resume", worker_thread) 270 # worker thread: Debugger.paused 271 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 272 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 273 assert response['params']['reason'] == 'other' 274 assert response['params']['hitBreakpoints'] == ['id:76:5:' + self.config['file_path']['worker']] 275 ################################################################################################################ 276 # worker thread: Debugger.evaluateOnCallFrame 277 ################################################################################################################ 278 params = debugger.EvaluateOnCallFrameParams('a') 279 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 280 assert response['result']['result'] == {"type": "number", "unserializableValue": "2", "description": "2"} 281 params = debugger.EvaluateOnCallFrameParams('d') 282 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 283 assert response['result']['result'] == {"type": "number", "unserializableValue": "4", "description": "4"} 284 ################################################################################################################ 285 # worker thread: Debugger.dropFrame 286 ################################################################################################################ 287 params = debugger.DropFrameParams() 288 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 289 # worker thread: Debugger.paused 290 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 291 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 292 assert response['params']['reason'] == 'other' 293 assert response['params']['hitBreakpoints'] == [] 294 ################################################################################################################ 295 # worker thread: Debugger.evaluateOnCallFrame 296 ################################################################################################################ 297 params = debugger.EvaluateOnCallFrameParams('a') 298 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 299 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 300 params = debugger.EvaluateOnCallFrameParams('d') 301 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 302 assert response['result']['result'] == {"type": "number", "unserializableValue": "2", "description": "2"} 303 ################################################################################################################ 304 # worker thread: Debugger.dropFrame 305 ################################################################################################################ 306 params = debugger.DropFrameParams() 307 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 308 # worker thread: Debugger.paused 309 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 310 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 311 assert response['params']['reason'] == 'other' 312 assert response['params']['hitBreakpoints'] == [] 313 ################################################################################################################ 314 # worker thread: Debugger.evaluateOnCallFrame 315 ################################################################################################################ 316 params = debugger.EvaluateOnCallFrameParams('a') 317 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 318 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 319 params = debugger.EvaluateOnCallFrameParams('d') 320 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 321 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 322 ################################################################################################################ 323 # worker thread: Debugger.removeBreakpointsByUrl 324 ################################################################################################################ 325 params = debugger.RemoveBreakpointsUrl(self.config['file_path']['worker']) 326 await self.debugger_impl.send("Debugger.removeBreakpointsByUrl", worker_thread, params) 327 ################################################################################################################ 328 # worker thread: Debugger.getPossibleAndSetBreakpointByUrl 329 ################################################################################################################ 330 locations = [debugger.BreakLocationUrl(url=self.config['file_path']['worker'], line_number=90)] 331 params = debugger.SetBreakpointsLocations(locations) 332 response = await self.debugger_impl.send("Debugger.getPossibleAndSetBreakpointsByUrl", 333 worker_thread, params) 334 assert response['result']['locations'][0]['id'] == 'id:90:0:' + self.config['file_path']['worker'] 335 ################################################################################################################ 336 # worker thread: Debugger.resume 337 ################################################################################################################ 338 await self.debugger_impl.send("Debugger.resume", worker_thread) 339 # worker thread: Debugger.paused 340 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 341 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 342 assert response['params']['reason'] == 'other' 343 assert response['params']['hitBreakpoints'] == ['id:90:5:' + self.config['file_path']['worker']] 344 ################################################################################################################ 345 # worker thread: Debugger.resume 346 ################################################################################################################ 347 await self.debugger_impl.send("Debugger.resume", worker_thread) 348 # worker thread: Debugger.paused 349 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 350 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 351 assert response['params']['reason'] == 'other' 352 assert response['params']['hitBreakpoints'] == ['id:90:5:' + self.config['file_path']['worker']] 353 ################################################################################################################ 354 # worker thread: Debugger.evaluateOnCallFrame 355 ################################################################################################################ 356 params = debugger.EvaluateOnCallFrameParams('a') 357 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 358 assert response['result']['result'] == {"type": "number", "unserializableValue": "4", "description": "4"} 359 params = debugger.EvaluateOnCallFrameParams('d') 360 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 361 assert response['result']['result'] == {"type": "number", "unserializableValue": "24", "description": "24"} 362 ################################################################################################################ 363 # worker thread: Debugger.dropFrame 364 ################################################################################################################ 365 params = debugger.DropFrameParams() 366 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 367 # worker thread: Debugger.paused 368 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 369 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 370 assert response['params']['reason'] == 'other' 371 assert response['params']['hitBreakpoints'] == [] 372 ################################################################################################################ 373 # worker thread: Debugger.evaluateOnCallFrame 374 ################################################################################################################ 375 params = debugger.EvaluateOnCallFrameParams('a') 376 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 377 assert response['result']['result'] == {"type": "number", "unserializableValue": "2", "description": "2"} 378 params = debugger.EvaluateOnCallFrameParams('d') 379 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 380 assert response['result']['result'] == {"type": "number", "unserializableValue": "4", "description": "4"} 381 ################################################################################################################ 382 # worker thread: Debugger.removeBreakpointsByUrl 383 ################################################################################################################ 384 params = debugger.RemoveBreakpointsUrl(self.config['file_path']['worker']) 385 await self.debugger_impl.send("Debugger.removeBreakpointsByUrl", worker_thread, params) 386 ################################################################################################################ 387 # worker thread: Debugger.getPossibleAndSetBreakpointByUrl 388 ################################################################################################################ 389 locations = [debugger.BreakLocationUrl(url=self.config['file_path']['worker'], line_number=104)] 390 params = debugger.SetBreakpointsLocations(locations) 391 response = await self.debugger_impl.send("Debugger.getPossibleAndSetBreakpointsByUrl", 392 worker_thread, params) 393 assert response['result']['locations'][0]['id'] == 'id:104:0:' + self.config['file_path']['worker'] 394 ################################################################################################################ 395 # worker thread: Debugger.resume 396 ################################################################################################################ 397 await self.debugger_impl.send("Debugger.resume", worker_thread) 398 # worker thread: Debugger.paused 399 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 400 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 401 assert response['params']['reason'] == 'other' 402 assert response['params']['hitBreakpoints'] == ['id:104:13:' + self.config['file_path']['worker']] 403 ################################################################################################################ 404 # worker thread: Debugger.resume 405 ################################################################################################################ 406 await self.debugger_impl.send("Debugger.resume", worker_thread) 407 # worker thread: Debugger.paused 408 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 409 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 410 assert response['params']['reason'] == 'other' 411 assert response['params']['hitBreakpoints'] == ['id:104:13:' + self.config['file_path']['worker']] 412 ################################################################################################################ 413 # worker thread: Debugger.evaluateOnCallFrame 414 ################################################################################################################ 415 params = debugger.EvaluateOnCallFrameParams('a') 416 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 417 assert response['result']['result'] == {"type": "number", "unserializableValue": "3", "description": "3"} 418 params = debugger.EvaluateOnCallFrameParams('d') 419 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 420 assert response['result']['result'] == {"type": "number", "unserializableValue": "26", "description": "26"} 421 ################################################################################################################ 422 # worker thread: Debugger.dropFrame 423 ################################################################################################################ 424 params = debugger.DropFrameParams() 425 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 426 # worker thread: Debugger.paused 427 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 428 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 429 assert response['params']['reason'] == 'other' 430 assert response['params']['hitBreakpoints'] == [] 431 ################################################################################################################ 432 # worker thread: Debugger.evaluateOnCallFrame 433 ################################################################################################################ 434 params = debugger.EvaluateOnCallFrameParams('a') 435 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 436 assert response['result']['result'] == {"type": "number", "unserializableValue": "2", "description": "2"} 437 params = debugger.EvaluateOnCallFrameParams('d') 438 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 439 assert response['result']['result'] == {"type": "number", "unserializableValue": "12", "description": "12"} 440 ################################################################################################################ 441 # worker thread: Debugger.removeBreakpointsByUrl 442 ################################################################################################################ 443 params = debugger.RemoveBreakpointsUrl(self.config['file_path']['worker']) 444 await self.debugger_impl.send("Debugger.removeBreakpointsByUrl", worker_thread, params) 445 ################################################################################################################ 446 # worker thread: Debugger.getPossibleAndSetBreakpointByUrl 447 ################################################################################################################ 448 locations = [debugger.BreakLocationUrl(url=self.config['file_path']['worker'], line_number=121)] 449 params = debugger.SetBreakpointsLocations(locations) 450 response = await self.debugger_impl.send("Debugger.getPossibleAndSetBreakpointsByUrl", 451 worker_thread, params) 452 assert response['result']['locations'][0]['id'] == 'id:121:0:' + self.config['file_path']['worker'] 453 ################################################################################################################ 454 # worker thread: Debugger.resume 455 ################################################################################################################ 456 await self.debugger_impl.send("Debugger.resume", worker_thread) 457 # worker thread: Debugger.paused 458 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 459 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 460 assert response['params']['reason'] == 'other' 461 assert response['params']['hitBreakpoints'] == ['id:121:9:' + self.config['file_path']['worker']] 462 ################################################################################################################ 463 # worker thread: Debugger.evaluateOnCallFrame 464 ################################################################################################################ 465 params = debugger.EvaluateOnCallFrameParams('s') 466 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 467 assert response['result']['result'] == {"type": "number", "unserializableValue": "3", "description": "3"} 468 params = debugger.EvaluateOnCallFrameParams('func') 469 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 470 function_info = response['result']['result'] 471 assert function_info['type'] == 'function' 472 ################################################################################################################ 473 # worker thread: Debugger.dropFrame 474 ################################################################################################################ 475 params = debugger.DropFrameParams() 476 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 477 # worker thread: Debugger.paused 478 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 479 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 480 assert response['params']['reason'] == 'other' 481 assert response['params']['hitBreakpoints'] == [] 482 ################################################################################################################ 483 # worker thread: Debugger.evaluateOnCallFrame 484 ################################################################################################################ 485 params = debugger.EvaluateOnCallFrameParams('s') 486 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 487 assert response['result']['result']['type'] == "undefined" 488 params = debugger.EvaluateOnCallFrameParams('func') 489 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 490 assert response['result']['result']['description'] != function_info['description'] 491 assert response['result']['result']['type'] == 'function' 492 ################################################################################################################ 493 # worker thread: Debugger.removeBreakpointsByUrl 494 ################################################################################################################ 495 params = debugger.RemoveBreakpointsUrl(self.config['file_path']['worker']) 496 await self.debugger_impl.send("Debugger.removeBreakpointsByUrl", worker_thread, params) 497 ################################################################################################################ 498 # worker thread: Debugger.getPossibleAndSetBreakpointByUrl 499 ################################################################################################################ 500 locations = [debugger.BreakLocationUrl(url=self.config['file_path']['worker'], line_number=136)] 501 params = debugger.SetBreakpointsLocations(locations) 502 response = await self.debugger_impl.send("Debugger.getPossibleAndSetBreakpointsByUrl", 503 worker_thread, params) 504 assert response['result']['locations'][0]['id'] == 'id:136:0:' + self.config['file_path']['worker'] 505 ################################################################################################################ 506 # worker thread: Debugger.resume 507 ################################################################################################################ 508 await self.debugger_impl.send("Debugger.resume", worker_thread) 509 # worker thread: Debugger.paused 510 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 511 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 512 assert response['params']['reason'] == 'other' 513 assert response['params']['hitBreakpoints'] == ['id:136:1:' + self.config['file_path']['worker']] 514 ################################################################################################################ 515 # worker thread: Debugger.evaluateOnCallFrame 516 ################################################################################################################ 517 params = debugger.EvaluateOnCallFrameParams('a') 518 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 519 assert response['result']['result'] == {"type": "number", "unserializableValue": "11", "description": "11"} 520 params = debugger.EvaluateOnCallFrameParams('x') 521 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 522 assert response['result']['result'] == {"type": "number", "unserializableValue": "8", "description": "8"} 523 ################################################################################################################ 524 # worker thread: Debugger.dropFrame 525 ################################################################################################################ 526 params = debugger.DropFrameParams() 527 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 528 # worker thread: Debugger.paused 529 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 530 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 531 assert response['params']['reason'] == 'other' 532 assert response['params']['hitBreakpoints'] == [] 533 ################################################################################################################ 534 # worker thread: Debugger.evaluateOnCallFrame 535 ################################################################################################################ 536 params = debugger.EvaluateOnCallFrameParams('a') 537 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 538 assert response['result']['result'] == {"type": "number", "unserializableValue": "9", "description": "9"} 539 params = debugger.EvaluateOnCallFrameParams('x') 540 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 541 assert response['result']['result'] == {"type": "number", "unserializableValue": "7", "description": "7"} 542 ################################################################################################################ 543 # worker thread: Debugger.dropFrame 544 ################################################################################################################ 545 params = debugger.DropFrameParams() 546 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 547 # worker thread: Debugger.paused 548 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 549 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 550 assert response['params']['reason'] == 'other' 551 assert response['params']['hitBreakpoints'] == [] 552 ################################################################################################################ 553 # worker thread: Debugger.evaluateOnCallFrame 554 ################################################################################################################ 555 params = debugger.EvaluateOnCallFrameParams('a') 556 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 557 assert response['result']['result'] == {"type": "number", "unserializableValue": "8", "description": "8"} 558 params = debugger.EvaluateOnCallFrameParams('x') 559 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 560 assert response['result']['result'] == {"type": "number", "unserializableValue": "7", "description": "7"} 561 ################################################################################################################ 562 # worker thread: Debugger.removeBreakpointsByUrl 563 ################################################################################################################ 564 params = debugger.RemoveBreakpointsUrl(self.config['file_path']['worker']) 565 await self.debugger_impl.send("Debugger.removeBreakpointsByUrl", worker_thread, params) 566 ################################################################################################################ 567 # worker thread: Debugger.getPossibleAndSetBreakpointByUrl 568 ################################################################################################################ 569 locations = [debugger.BreakLocationUrl(url=self.config['file_path']['worker'], line_number=146)] 570 params = debugger.SetBreakpointsLocations(locations) 571 response = await self.debugger_impl.send("Debugger.getPossibleAndSetBreakpointsByUrl", 572 worker_thread, params) 573 assert response['result']['locations'][0]['id'] == 'id:146:0:' + self.config['file_path']['worker'] 574 ################################################################################################################ 575 # worker thread: Debugger.resume 576 ################################################################################################################ 577 await self.debugger_impl.send("Debugger.resume", worker_thread) 578 # worker thread: Debugger.paused 579 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 580 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 581 assert response['params']['reason'] == 'other' 582 assert response['params']['hitBreakpoints'] == ['id:146:5:' + self.config['file_path']['worker']] 583 ################################################################################################################ 584 # worker thread: Debugger.evaluateOnCallFrame 585 ################################################################################################################ 586 params = debugger.EvaluateOnCallFrameParams('a') 587 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 588 assert response['result']['result'] == {"type": "number", "unserializableValue": "10", "description": "10"} 589 params = debugger.EvaluateOnCallFrameParams('d') 590 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 591 assert response['result']['result'] == {"type": "number", "unserializableValue": "12", "description": "12"} 592 ################################################################################################################ 593 # worker thread: Debugger.dropFrame 594 ################################################################################################################ 595 params = debugger.DropFrameParams() 596 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 597 # worker thread: Debugger.paused 598 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 599 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 600 assert response['params']['reason'] == 'other' 601 assert response['params']['hitBreakpoints'] == [] 602 ################################################################################################################ 603 # worker thread: Debugger.evaluateOnCallFrame 604 ################################################################################################################ 605 params = debugger.EvaluateOnCallFrameParams('a') 606 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 607 assert response['result']['result'] == {"type": "number", "unserializableValue": "0", "description": "0"} 608 params = debugger.EvaluateOnCallFrameParams('d') 609 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 610 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 611 ################################################################################################################ 612 # worker thread: Debugger.removeBreakpointsByUrl 613 ################################################################################################################ 614 params = debugger.RemoveBreakpointsUrl(self.config['file_path']['worker']) 615 await self.debugger_impl.send("Debugger.removeBreakpointsByUrl", worker_thread, params) 616 ################################################################################################################ 617 # worker thread: Debugger.getPossibleAndSetBreakpointByUrl 618 ################################################################################################################ 619 locations = [debugger.BreakLocationUrl(url=self.config['file_path']['worker'], line_number=160)] 620 params = debugger.SetBreakpointsLocations(locations) 621 response = await self.debugger_impl.send("Debugger.getPossibleAndSetBreakpointsByUrl", 622 worker_thread, params) 623 assert response['result']['locations'][0]['id'] == 'id:160:0:' + self.config['file_path']['worker'] 624 ################################################################################################################ 625 # worker thread: Debugger.resume 626 ################################################################################################################ 627 await self.debugger_impl.send("Debugger.resume", worker_thread) 628 # worker thread: Debugger.paused 629 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 630 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 631 assert response['params']['reason'] == 'other' 632 assert response['params']['hitBreakpoints'] == ['id:160:13:' + self.config['file_path']['worker']] 633 ################################################################################################################ 634 # worker thread: Debugger.evaluateOnCallFrame 635 ################################################################################################################ 636 params = debugger.EvaluateOnCallFrameParams('a') 637 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 638 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 639 params = debugger.EvaluateOnCallFrameParams('d') 640 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 641 assert response['result']['result'] == {"type": "number", "unserializableValue": "5", "description": "5"} 642 params = debugger.EvaluateOnCallFrameParams('e') 643 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 644 assert response['result']['result'] == {"type": "number", "unserializableValue": "12", "description": "12"} 645 ################################################################################################################ 646 # worker thread: Debugger.dropFrame 647 ################################################################################################################ 648 params = debugger.DropFrameParams() 649 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 650 # worker thread: Debugger.paused 651 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 652 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 653 assert response['params']['reason'] == 'other' 654 assert response['params']['hitBreakpoints'] == [] 655 ################################################################################################################ 656 # worker thread: Debugger.evaluateOnCallFrame 657 ################################################################################################################ 658 params = debugger.EvaluateOnCallFrameParams('a') 659 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 660 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 661 params = debugger.EvaluateOnCallFrameParams('d') 662 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 663 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 664 params = debugger.EvaluateOnCallFrameParams('e') 665 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 666 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 667 ################################################################################################################ 668 # worker thread: Debugger.dropFrame 669 ################################################################################################################ 670 params = debugger.DropFrameParams() 671 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 672 # worker thread: Debugger.paused 673 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 674 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 675 assert response['params']['reason'] == 'other' 676 assert response['params']['hitBreakpoints'] == [] 677 ################################################################################################################ 678 # worker thread: Debugger.evaluateOnCallFrame 679 ################################################################################################################ 680 params = debugger.EvaluateOnCallFrameParams('a') 681 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 682 assert response['result']['result'] == {"type": "number", "unserializableValue": "0", "description": "0"} 683 params = debugger.EvaluateOnCallFrameParams('d') 684 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 685 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 686 params = debugger.EvaluateOnCallFrameParams('e') 687 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 688 assert response['result']['result']['type'] == "undefined" 689 ################################################################################################################ 690 # worker thread: Debugger.removeBreakpointsByUrl 691 ################################################################################################################ 692 params = debugger.RemoveBreakpointsUrl(self.config['file_path']['worker']) 693 await self.debugger_impl.send("Debugger.removeBreakpointsByUrl", worker_thread, params) 694 ################################################################################################################ 695 # worker thread: Debugger.getPossibleAndSetBreakpointByUrl 696 ################################################################################################################ 697 locations = [debugger.BreakLocationUrl(url=self.config['file_path']['worker'], line_number=171)] 698 params = debugger.SetBreakpointsLocations(locations) 699 response = await self.debugger_impl.send("Debugger.getPossibleAndSetBreakpointsByUrl", 700 worker_thread, params) 701 assert response['result']['locations'][0]['id'] == 'id:171:0:' + self.config['file_path']['worker'] 702 ################################################################################################################ 703 # worker thread: Debugger.resume 704 ################################################################################################################ 705 await self.debugger_impl.send("Debugger.resume", worker_thread) 706 # worker thread: Debugger.paused 707 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 708 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 709 assert response['params']['reason'] == 'other' 710 assert response['params']['hitBreakpoints'] == ['id:171:13:' + self.config['file_path']['worker']] 711 ################################################################################################################ 712 # worker thread: Debugger.evaluateOnCallFrame 713 ################################################################################################################ 714 params = debugger.EvaluateOnCallFrameParams('a') 715 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 716 assert response['result']['result'] == {"type": "number", "unserializableValue": "2", "description": "2"} 717 params = debugger.EvaluateOnCallFrameParams('d') 718 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 719 assert response['result']['result'] == {"type": "number", "unserializableValue": "9", "description": "9"} 720 params = debugger.EvaluateOnCallFrameParams('e') 721 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 722 assert response['result']['result'] == {"type": "number", "unserializableValue": "22", "description": "22"} 723 ################################################################################################################ 724 # worker thread: Debugger.dropFrame 725 ################################################################################################################ 726 params = debugger.DropFrameParams() 727 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 728 # worker thread: Debugger.paused 729 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 730 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 731 assert response['params']['reason'] == 'other' 732 assert response['params']['hitBreakpoints'] == [] 733 ################################################################################################################ 734 # worker thread: Debugger.evaluateOnCallFrame 735 ################################################################################################################ 736 params = debugger.EvaluateOnCallFrameParams('a') 737 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 738 assert response['result']['result'] == {"type": "number", "unserializableValue": "2", "description": "2"} 739 params = debugger.EvaluateOnCallFrameParams('d') 740 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 741 assert response['result']['result'] == {"type": "number", "unserializableValue": "5", "description": "5"} 742 params = debugger.EvaluateOnCallFrameParams('e') 743 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 744 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 745 ################################################################################################################ 746 # worker thread: Debugger.dropFrame 747 ################################################################################################################ 748 params = debugger.DropFrameParams() 749 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 750 # worker thread: Debugger.paused 751 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 752 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 753 assert response['params']['reason'] == 'other' 754 assert response['params']['hitBreakpoints'] == [] 755 ################################################################################################################ 756 # worker thread: Debugger.evaluateOnCallFrame 757 ################################################################################################################ 758 params = debugger.EvaluateOnCallFrameParams('a') 759 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 760 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 761 params = debugger.EvaluateOnCallFrameParams('d') 762 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 763 assert response['result']['result'] == {"type": "number", "unserializableValue": "5", "description": "5"} 764 params = debugger.EvaluateOnCallFrameParams('e') 765 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 766 assert response['result']['result']['type'] == "undefined" 767 ################################################################################################################ 768 # worker thread: Debugger.removeBreakpointsByUrl 769 ################################################################################################################ 770 params = debugger.RemoveBreakpointsUrl(self.config['file_path']['worker']) 771 await self.debugger_impl.send("Debugger.removeBreakpointsByUrl", worker_thread, params) 772 ################################################################################################################ 773 # worker thread: Debugger.getPossibleAndSetBreakpointByUrl 774 ################################################################################################################ 775 locations = [debugger.BreakLocationUrl(url=self.config['file_path']['worker'], line_number=189)] 776 params = debugger.SetBreakpointsLocations(locations) 777 response = await self.debugger_impl.send("Debugger.getPossibleAndSetBreakpointsByUrl", 778 worker_thread, params) 779 assert response['result']['locations'][0]['id'] == 'id:189:0:' + self.config['file_path']['worker'] 780 ################################################################################################################ 781 # worker thread: Debugger.resume 782 ################################################################################################################ 783 await self.debugger_impl.send("Debugger.resume", worker_thread) 784 # worker thread: Debugger.paused 785 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 786 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 787 assert response['params']['reason'] == 'other' 788 assert response['params']['hitBreakpoints'] == ['id:189:13:' + self.config['file_path']['worker']] 789 ################################################################################################################ 790 # worker thread: Debugger.evaluateOnCallFrame 791 ################################################################################################################ 792 params = debugger.EvaluateOnCallFrameParams('a') 793 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 794 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 795 params = debugger.EvaluateOnCallFrameParams('d') 796 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 797 assert response['result']['result'] == {"type": "number", "unserializableValue": "14", "description": "14"} 798 params = debugger.EvaluateOnCallFrameParams('e') 799 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 800 assert response['result']['result'] == {"type": "number", "unserializableValue": "21", "description": "21"} 801 ################################################################################################################ 802 # worker thread: Debugger.dropFrame 803 ################################################################################################################ 804 params = debugger.DropFrameParams() 805 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 806 # worker thread: Debugger.paused 807 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 808 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 809 assert response['params']['reason'] == 'other' 810 assert response['params']['hitBreakpoints'] == [] 811 ################################################################################################################ 812 # worker thread: Debugger.evaluateOnCallFrame 813 ################################################################################################################ 814 params = debugger.EvaluateOnCallFrameParams('a') 815 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 816 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 817 params = debugger.EvaluateOnCallFrameParams('d') 818 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 819 assert response['result']['result'] == {"type": "number", "unserializableValue": "10", "description": "10"} 820 params = debugger.EvaluateOnCallFrameParams('e') 821 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 822 assert response['result']['result'] == {"type": "number", "unserializableValue": "1", "description": "1"} 823 ################################################################################################################ 824 # worker thread: Debugger.dropFrame 825 ################################################################################################################ 826 params = debugger.DropFrameParams() 827 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 828 # worker thread: Debugger.paused 829 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 830 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 831 assert response['params']['reason'] == 'other' 832 assert response['params']['hitBreakpoints'] == [] 833 ################################################################################################################ 834 # worker thread: Debugger.evaluateOnCallFrame 835 ################################################################################################################ 836 params = debugger.EvaluateOnCallFrameParams('a') 837 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 838 assert response['result']['result'] == {"type": "number", "unserializableValue": "0", "description": "0"} 839 params = debugger.EvaluateOnCallFrameParams('d') 840 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 841 assert response['result']['result'] == {"type": "number", "unserializableValue": "10", "description": "10"} 842 params = debugger.EvaluateOnCallFrameParams('e') 843 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 844 assert response['result']['result']['type'] == "undefined" 845 ################################################################################################################ 846 # worker thread: Debugger.removeBreakpointsByUrl 847 ################################################################################################################ 848 params = debugger.RemoveBreakpointsUrl(self.config['file_path']['worker']) 849 await self.debugger_impl.send("Debugger.removeBreakpointsByUrl", worker_thread, params) 850 ################################################################################################################ 851 # worker thread: Debugger.getPossibleAndSetBreakpointByUrl 852 ################################################################################################################ 853 locations = [debugger.BreakLocationUrl(url=self.config['file_path']['worker'], line_number=205)] 854 params = debugger.SetBreakpointsLocations(locations) 855 response = await self.debugger_impl.send("Debugger.getPossibleAndSetBreakpointsByUrl", 856 worker_thread, params) 857 assert response['result']['locations'][0]['id'] == 'id:205:0:' + self.config['file_path']['worker'] 858 ################################################################################################################ 859 # worker thread: Debugger.resume 860 ################################################################################################################ 861 await self.debugger_impl.send("Debugger.resume", worker_thread) 862 # worker thread: Debugger.paused 863 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 864 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 865 assert response['params']['reason'] == 'other' 866 assert response['params']['hitBreakpoints'] == ['id:205:9:' + self.config['file_path']['worker']] 867 ################################################################################################################ 868 # worker thread: Debugger.evaluateOnCallFrame 869 ################################################################################################################ 870 params = debugger.EvaluateOnCallFrameParams('a') 871 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 872 assert response['result']['result'] == {"type": "number", "unserializableValue": "3", "description": "3"} 873 params = debugger.EvaluateOnCallFrameParams('d') 874 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 875 assert response['result']['result'] == {"type": "number", "unserializableValue": "17", "description": "17"} 876 ################################################################################################################ 877 # worker thread: Debugger.dropFrame 878 ################################################################################################################ 879 params = debugger.DropFrameParams() 880 await self.debugger_impl.send("Debugger.dropFrame", worker_thread, params) 881 # worker thread: Debugger.paused 882 response = await self.debugger_impl.recv("Debugger.paused", worker_thread) 883 assert response['params']['callFrames'][0]['url'] == self.config['file_path']['worker'] 884 assert response['params']['reason'] == 'other' 885 assert response['params']['hitBreakpoints'] == [] 886 ################################################################################################################ 887 # worker thread: Debugger.evaluateOnCallFrame 888 ################################################################################################################ 889 params = debugger.EvaluateOnCallFrameParams('a') 890 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 891 assert response['result']['result'] == {"type": "number", "unserializableValue": "2", "description": "2"} 892 params = debugger.EvaluateOnCallFrameParams('d') 893 response = await self.debugger_impl.send("Debugger.evaluateOnCallFrame", worker_thread, params) 894 assert response['result']['result'] == {"type": "number", "unserializableValue": "14", "description": "14"} 895 ################################################################################################################ 896 # worker thread: Debugger.removeBreakpointsByUrl 897 ################################################################################################################ 898 params = debugger.RemoveBreakpointsUrl(self.config['file_path']['worker']) 899 await self.debugger_impl.send("Debugger.removeBreakpointsByUrl", worker_thread, params) 900 ################################################################################################################ 901 # worker thread: Debugger.resume 902 ################################################################################################################ 903 await self.debugger_impl.send("Debugger.resume", worker_thread) 904 ################################################################################################################ 905 # worker thread: Debugger.disable 906 ################################################################################################################ 907 await self.debugger_impl.send("Debugger.disable", worker_thread) 908 ################################################################################################################ 909 # main thread: Debugger.disable 910 ################################################################################################################ 911 await self.debugger_impl.send("Debugger.disable", main_thread) 912 ################################################################################################################ 913 # close the websocket connections 914 ################################################################################################################ 915 await websocket.send_msg_to_debugger_server(worker_thread.instance_id, worker_thread.send_msg_queue, 'close') 916 await websocket.send_msg_to_debugger_server(main_thread.instance_id, main_thread.send_msg_queue, 'close') 917 await websocket.send_msg_to_connect_server('close') 918 ################################################################################################################