OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 test.assertEquals('Simple content script', values[1]); | 864 test.assertEquals('Simple content script', values[1]); |
865 test.releaseControl(); | 865 test.releaseControl(); |
866 } | 866 } |
867 }; | 867 }; |
868 | 868 |
869 TestSuite.prototype.testDevToolsSharedWorker = function() { | 869 TestSuite.prototype.testDevToolsSharedWorker = function() { |
870 this.takeControl(); | 870 this.takeControl(); |
871 Bindings.TempFile.ensureTempStorageCleared().then(() => this.releaseControl(
)); | 871 Bindings.TempFile.ensureTempStorageCleared().then(() => this.releaseControl(
)); |
872 }; | 872 }; |
873 | 873 |
| 874 TestSuite.prototype.testTempFile = function() { |
| 875 this.takeControl(); |
| 876 Bindings.TempFile.create('test-file', 'test') |
| 877 .then(() => this.releaseControl(), (error) => this.fail(String(error))); |
| 878 }; |
| 879 |
874 TestSuite.prototype.waitForTestResultsInConsole = function() { | 880 TestSuite.prototype.waitForTestResultsInConsole = function() { |
875 var messages = SDK.multitargetConsoleModel.messages(); | 881 var messages = SDK.multitargetConsoleModel.messages(); |
876 for (var i = 0; i < messages.length; ++i) { | 882 for (var i = 0; i < messages.length; ++i) { |
877 var text = messages[i].messageText; | 883 var text = messages[i].messageText; |
878 if (text === 'PASS') | 884 if (text === 'PASS') |
879 return; | 885 return; |
880 else if (/^FAIL/.test(text)) | 886 else if (/^FAIL/.test(text)) |
881 this.fail(text); // This will throw. | 887 this.fail(text); // This will throw. |
882 } | 888 } |
883 // Neither PASS nor FAIL, so wait for more messages. | 889 // Neither PASS nor FAIL, so wait for more messages. |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 if (runtimeModel.executionContexts().length >= n) | 1110 if (runtimeModel.executionContexts().length >= n) |
1105 callback.call(null); | 1111 callback.call(null); |
1106 else | 1112 else |
1107 this.addSniffer(SDK.RuntimeModel.prototype, '_executionContextCreated',
checkForExecutionContexts.bind(this)); | 1113 this.addSniffer(SDK.RuntimeModel.prototype, '_executionContextCreated',
checkForExecutionContexts.bind(this)); |
1108 } | 1114 } |
1109 }; | 1115 }; |
1110 | 1116 |
1111 | 1117 |
1112 window.uiTests = new TestSuite(window.domAutomationController); | 1118 window.uiTests = new TestSuite(window.domAutomationController); |
1113 })(window); | 1119 })(window); |
OLD | NEW |