OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 // This has to be updated if the number of native scripts change. | 77 // This has to be updated if the number of native scripts change. |
78 assertEquals(%NativeScriptsCount(), named_native_count); | 78 assertEquals(%NativeScriptsCount(), named_native_count); |
79 // The 'gc' extension and one or two extras scripts are loaded. | 79 // The 'gc' extension and one or two extras scripts are loaded. |
80 assertTrue(extension_count == 2 || extension_count == 3); | 80 assertTrue(extension_count == 2 || extension_count == 3); |
81 // This script, test-api.js and mjsunit.js has been loaded. If using d8, d8 | 81 // This script, test-api.js and mjsunit.js has been loaded. If using d8, d8 |
82 // loads a normal script during startup too. | 82 // loads a normal script during startup too. |
83 assertTrue(normal_count == 3 || normal_count == 4); | 83 assertTrue(normal_count == 3 || normal_count == 4); |
84 assertTrue(inspector_count == 2); | 84 assertTrue(inspector_count == 1); |
85 | 85 |
86 // Test a builtins script. | 86 // Test a builtins script. |
87 var array_script = Debug.findScript('native array.js'); | 87 var array_script = Debug.findScript('native array.js'); |
88 assertEquals('native array.js', array_script.name); | 88 assertEquals('native array.js', array_script.name); |
89 assertEquals(Debug.ScriptType.Native, array_script.type); | 89 assertEquals(Debug.ScriptType.Native, array_script.type); |
90 | 90 |
91 // Test a debugger script. | 91 // Test a debugger script. |
92 var debug_delay_script = Debug.findScript('native debug.js'); | 92 var debug_delay_script = Debug.findScript('native debug.js'); |
93 assertEquals('native debug.js', debug_delay_script.name); | 93 assertEquals('native debug.js', debug_delay_script.name); |
94 assertEquals(Debug.ScriptType.Native, debug_delay_script.type); | 94 assertEquals(Debug.ScriptType.Native, debug_delay_script.type); |
95 | 95 |
96 // Test an extension script. | 96 // Test an extension script. |
97 var extension_gc_script = Debug.findScript('v8/gc'); | 97 var extension_gc_script = Debug.findScript('v8/gc'); |
98 if (extension_gc_script) { | 98 if (extension_gc_script) { |
99 assertEquals('v8/gc', extension_gc_script.name); | 99 assertEquals('v8/gc', extension_gc_script.name); |
100 assertEquals(Debug.ScriptType.Extension, extension_gc_script.type); | 100 assertEquals(Debug.ScriptType.Extension, extension_gc_script.type); |
101 } | 101 } |
102 | 102 |
103 // Test a normal script. | 103 // Test a normal script. |
104 var debug_script = Debug.findScript(/debug-script.js/); | 104 var debug_script = Debug.findScript(/debug-script.js/); |
105 assertTrue(/debug-script.js/.test(debug_script.name)); | 105 assertTrue(/debug-script.js/.test(debug_script.name)); |
106 assertEquals(Debug.ScriptType.Normal, debug_script.type); | 106 assertEquals(Debug.ScriptType.Normal, debug_script.type); |
107 | 107 |
108 // Check a nonexistent script. | 108 // Check a nonexistent script. |
109 var dummy_script = Debug.findScript('dummy.js'); | 109 var dummy_script = Debug.findScript('dummy.js'); |
110 assertTrue(typeof dummy_script == 'undefined'); | 110 assertTrue(typeof dummy_script == 'undefined'); |
111 | 111 |
112 Debug.setListener(null); | 112 Debug.setListener(null); |
OLD | NEW |