Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!-- | 1 <!-- |
| 2 Copyright (C) 2012 Samsung Electronics. All rights reserved. | 2 Copyright (C) 2012 Samsung Electronics. All rights reserved. |
| 3 | 3 |
| 4 Redistribution and use in source and binary forms, with or without | 4 Redistribution and use in source and binary forms, with or without |
| 5 modification, are permitted provided that the following conditions | 5 modification, are permitted provided that the following conditions |
| 6 are met: | 6 are met: |
| 7 | 7 |
| 8 1. Redistributions of source code must retain the above copyright | 8 1. Redistributions of source code must retain the above copyright |
| 9 notice, this list of conditions and the following disclaimer. | 9 notice, this list of conditions and the following disclaimer. |
| 10 2. Redistributions in binary form must reproduce the above copyright | 10 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 } | 76 } |
| 77 | 77 |
| 78 InspectorTest.sendCommandPromise = function(method, params) | 78 InspectorTest.sendCommandPromise = function(method, params) |
| 79 { | 79 { |
| 80 var callback; | 80 var callback; |
| 81 var promise = new Promise(fulfill => callback = fulfill); | 81 var promise = new Promise(fulfill => callback = fulfill); |
| 82 InspectorTest.sendCommand(method, params, callback); | 82 InspectorTest.sendCommand(method, params, callback); |
| 83 return promise; | 83 return promise; |
| 84 } | 84 } |
| 85 | 85 |
| 86 InspectorTest.waitForEventPromise = function(eventName) | |
| 87 { | |
| 88 return new Promise(fulfill => InspectorTest.eventHandler[eventName] = fulfil l); | |
|
dgozman
2016/08/12 23:14:13
Please remove from eventHandler after it's called.
kozy
2016/08/12 23:38:59
Done.
| |
| 89 } | |
| 90 | |
| 86 InspectorTest.domUndo = function(callback) | 91 InspectorTest.domUndo = function(callback) |
| 87 { | 92 { |
| 88 InspectorTest.sendCommandOrDie("DOM.undo", {}, callback); | 93 InspectorTest.sendCommandOrDie("DOM.undo", {}, callback); |
| 89 } | 94 } |
| 90 | 95 |
| 91 InspectorTest.undoAndNext = function(next) | 96 InspectorTest.undoAndNext = function(next) |
| 92 { | 97 { |
| 93 return InspectorTest.domUndo.bind(InspectorTest, next); | 98 return InspectorTest.domUndo.bind(InspectorTest, next); |
| 94 } | 99 } |
| 95 | 100 |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 356 delete InspectorTest._pageLoadedCallback; | 361 delete InspectorTest._pageLoadedCallback; |
| 357 if (callback) | 362 if (callback) |
| 358 callback(); | 363 callback(); |
| 359 } | 364 } |
| 360 | 365 |
| 361 window.addEventListener("load", InspectorTest.readyForTest.bind(InspectorTest), false); | 366 window.addEventListener("load", InspectorTest.readyForTest.bind(InspectorTest), false); |
| 362 | 367 |
| 363 </script> | 368 </script> |
| 364 </head> | 369 </head> |
| 365 </html> | 370 </html> |
| OLD | NEW |