OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 2 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 if (msg.error) { | 59 if (msg.error) { |
60 InspectorTest.log("ERROR: " + msg.error.message); | 60 InspectorTest.log("ERROR: " + msg.error.message); |
61 InspectorTest.completeTest(); | 61 InspectorTest.completeTest(); |
62 return; | 62 return; |
63 } | 63 } |
64 if (callback) | 64 if (callback) |
65 callback(msg.result); | 65 callback(msg.result); |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 InspectorTest.domUndo = function(callback) | |
yurys
2014/07/21 06:19:13
Why all these methods are in this file rather than
lushnikov
2014/07/24 12:34:39
It's a general purpose methods.
| |
70 { | |
71 InspectorTest.sendCommandOrDie("DOM.undo", {}, callback); | |
72 } | |
73 | |
74 InspectorTest.undoAndNext = function(next) | |
75 { | |
76 return InspectorTest.domUndo.bind(InspectorTest, next); | |
77 } | |
78 | |
79 InspectorTest.runTestSuite = function(testSuite) | |
80 { | |
81 function nextTest() | |
82 { | |
83 if (!testSuite.length) { | |
84 InspectorTest.completeTest(); | |
85 return; | |
86 } | |
87 var fun = testSuite.shift(); | |
88 InspectorTest.log("\nRunning test: " + fun.name); | |
89 fun(nextTest); | |
90 } | |
91 | |
92 nextTest(); | |
93 } | |
94 | |
69 /** | 95 /** |
70 * @param {function(object)=} callback | 96 * @param {function(object)=} callback |
71 */ | 97 */ |
72 InspectorTest.wrapCallback = function(callback) | 98 InspectorTest.wrapCallback = function(callback) |
73 { | 99 { |
74 /** | 100 /** |
75 * @param {object} message | 101 * @param {object} message |
76 */ | 102 */ |
77 function callbackWrapper(message) | 103 function callbackWrapper(message) |
78 { | 104 { |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
330 initializers += "(" + window[symbol].toString() + ")();\n"; | 356 initializers += "(" + window[symbol].toString() + ")();\n"; |
331 } | 357 } |
332 inspectorFrontend.postMessage(initializers + "(" + testFunction.toSt ring() +")();", "*"); | 358 inspectorFrontend.postMessage(initializers + "(" + testFunction.toSt ring() +")();", "*"); |
333 return; | 359 return; |
334 } | 360 } |
335 // Kill waiting process if failed to send. | 361 // Kill waiting process if failed to send. |
336 alert("Failed to send test function"); | 362 alert("Failed to send test function"); |
337 testRunner.notifyDone(); | 363 testRunner.notifyDone(); |
338 }); | 364 }); |
339 } | 365 } |
OLD | NEW |