| 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] = fullfi
llAndClearListener.bind(null, fulfill)); |
| 89 |
| 90 function fullfillAndClearListener(fulfill, result) |
| 91 { |
| 92 fulfill(result); |
| 93 delete InspectorTest.eventHandler[eventName]; |
| 94 } |
| 95 } |
| 96 |
| 86 InspectorTest.domUndo = function(callback) | 97 InspectorTest.domUndo = function(callback) |
| 87 { | 98 { |
| 88 InspectorTest.sendCommandOrDie("DOM.undo", {}, callback); | 99 InspectorTest.sendCommandOrDie("DOM.undo", {}, callback); |
| 89 } | 100 } |
| 90 | 101 |
| 91 InspectorTest.undoAndNext = function(next) | 102 InspectorTest.undoAndNext = function(next) |
| 92 { | 103 { |
| 93 return InspectorTest.domUndo.bind(InspectorTest, next); | 104 return InspectorTest.domUndo.bind(InspectorTest, next); |
| 94 } | 105 } |
| 95 | 106 |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 delete InspectorTest._pageLoadedCallback; | 367 delete InspectorTest._pageLoadedCallback; |
| 357 if (callback) | 368 if (callback) |
| 358 callback(); | 369 callback(); |
| 359 } | 370 } |
| 360 | 371 |
| 361 window.addEventListener("load", InspectorTest.readyForTest.bind(InspectorTest),
false); | 372 window.addEventListener("load", InspectorTest.readyForTest.bind(InspectorTest),
false); |
| 362 | 373 |
| 363 </script> | 374 </script> |
| 364 </head> | 375 </head> |
| 365 </html> | 376 </html> |
| OLD | NEW |