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 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 }; | 801 }; |
802 | 802 |
803 TestSuite.prototype.testSettings = function() { | 803 TestSuite.prototype.testSettings = function() { |
804 var test = this; | 804 var test = this; |
805 | 805 |
806 createSettings(); | 806 createSettings(); |
807 test.takeControl(); | 807 test.takeControl(); |
808 setTimeout(reset, 0); | 808 setTimeout(reset, 0); |
809 | 809 |
810 function createSettings() { | 810 function createSettings() { |
811 var localSetting = Common.settings.createSetting('local', undefined, true)
; | 811 var localSetting = Common.settings.createLocalSetting('local', undefined); |
812 localSetting.set({s: 'local', n: 1}); | 812 localSetting.set({s: 'local', n: 1}); |
813 var globalSetting = Common.settings.createSetting('global', undefined, fal
se); | 813 var globalSetting = Common.settings.createSetting('global', undefined); |
814 globalSetting.set({s: 'global', n: 2}); | 814 globalSetting.set({s: 'global', n: 2}); |
815 } | 815 } |
816 | 816 |
817 function reset() { | 817 function reset() { |
818 Runtime.experiments.clearForTest(); | 818 Runtime.experiments.clearForTest(); |
819 InspectorFrontendHost.getPreferences(gotPreferences); | 819 InspectorFrontendHost.getPreferences(gotPreferences); |
820 } | 820 } |
821 | 821 |
822 function gotPreferences(prefs) { | 822 function gotPreferences(prefs) { |
823 Main.Main._instanceForTest._createSettings(prefs); | 823 Main.Main._instanceForTest._createSettings(prefs); |
824 | 824 |
825 var localSetting = Common.settings.createSetting('local', undefined, true)
; | 825 var localSetting = Common.settings.createLocalSetting('local', undefined); |
826 test.assertEquals('object', typeof localSetting.get()); | 826 test.assertEquals('object', typeof localSetting.get()); |
827 test.assertEquals('local', localSetting.get().s); | 827 test.assertEquals('local', localSetting.get().s); |
828 test.assertEquals(1, localSetting.get().n); | 828 test.assertEquals(1, localSetting.get().n); |
829 var globalSetting = Common.settings.createSetting('global', undefined, fal
se); | 829 var globalSetting = Common.settings.createSetting('global', undefined); |
830 test.assertEquals('object', typeof globalSetting.get()); | 830 test.assertEquals('object', typeof globalSetting.get()); |
831 test.assertEquals('global', globalSetting.get().s); | 831 test.assertEquals('global', globalSetting.get().s); |
832 test.assertEquals(2, globalSetting.get().n); | 832 test.assertEquals(2, globalSetting.get().n); |
833 test.releaseControl(); | 833 test.releaseControl(); |
834 } | 834 } |
835 }; | 835 }; |
836 | 836 |
837 TestSuite.prototype.testWindowInitializedOnNavigateBack = function() { | 837 TestSuite.prototype.testWindowInitializedOnNavigateBack = function() { |
838 var messages = SDK.multitargetConsoleModel.messages(); | 838 var messages = SDK.multitargetConsoleModel.messages(); |
839 this.assertEquals(1, messages.length); | 839 this.assertEquals(1, messages.length); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1102 if (runtimeModel.executionContexts().length >= n) | 1102 if (runtimeModel.executionContexts().length >= n) |
1103 callback.call(null); | 1103 callback.call(null); |
1104 else | 1104 else |
1105 this.addSniffer(SDK.RuntimeModel.prototype, '_executionContextCreated',
checkForExecutionContexts.bind(this)); | 1105 this.addSniffer(SDK.RuntimeModel.prototype, '_executionContextCreated',
checkForExecutionContexts.bind(this)); |
1106 } | 1106 } |
1107 }; | 1107 }; |
1108 | 1108 |
1109 | 1109 |
1110 window.uiTests = new TestSuite(window.domAutomationController); | 1110 window.uiTests = new TestSuite(window.domAutomationController); |
1111 })(window); | 1111 })(window); |
OLD | NEW |