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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 // This has to be updated if the number of native scripts change. | 76 // This has to be updated if the number of native scripts change. |
77 assertEquals(%NativeScriptsCount(), named_native_count); | 77 assertEquals(%NativeScriptsCount(), named_native_count); |
78 // The 'gc' extension and one or two extras scripts are loaded. | 78 // The 'gc' extension and one or two extras scripts are loaded. |
79 assertTrue(extension_count == 2 || extension_count == 3); | 79 assertTrue(extension_count == 2 || extension_count == 3); |
80 // This script, test-api.js and mjsunit.js has been loaded. If using d8, d8 | 80 // This script, test-api.js and mjsunit.js has been loaded. If using d8, d8 |
81 // loads a normal script during startup too. | 81 // loads a normal script during startup too. |
82 assertTrue(normal_count == 3 || normal_count == 4); | 82 assertTrue(normal_count == 3 || normal_count == 4); |
83 assertTrue(inspector_count == 1); | 83 assertTrue(inspector_count == 2); |
84 | 84 |
85 // Test a builtins script. | 85 // Test a builtins script. |
86 var array_script = Debug.findScript('native array.js'); | 86 var array_script = Debug.findScript('native array.js'); |
87 assertEquals('native array.js', array_script.name); | 87 assertEquals('native array.js', array_script.name); |
88 assertEquals(Debug.ScriptType.Native, array_script.type); | 88 assertEquals(Debug.ScriptType.Native, array_script.type); |
89 | 89 |
90 // Test a debugger script. | 90 // Test a debugger script. |
91 var debug_delay_script = Debug.findScript('native debug.js'); | 91 var debug_delay_script = Debug.findScript('native debug.js'); |
92 assertEquals('native debug.js', debug_delay_script.name); | 92 assertEquals('native debug.js', debug_delay_script.name); |
93 assertEquals(Debug.ScriptType.Native, debug_delay_script.type); | 93 assertEquals(Debug.ScriptType.Native, debug_delay_script.type); |
94 | 94 |
95 // Test an extension script. | 95 // Test an extension script. |
96 var extension_gc_script = Debug.findScript('v8/gc'); | 96 var extension_gc_script = Debug.findScript('v8/gc'); |
97 if (extension_gc_script) { | 97 if (extension_gc_script) { |
98 assertEquals('v8/gc', extension_gc_script.name); | 98 assertEquals('v8/gc', extension_gc_script.name); |
99 assertEquals(Debug.ScriptType.Extension, extension_gc_script.type); | 99 assertEquals(Debug.ScriptType.Extension, extension_gc_script.type); |
100 } | 100 } |
101 | 101 |
102 // Test a normal script. | 102 // Test a normal script. |
103 var debug_script = Debug.findScript(/debug-script.js/); | 103 var debug_script = Debug.findScript(/debug-script.js/); |
104 assertTrue(/debug-script.js/.test(debug_script.name)); | 104 assertTrue(/debug-script.js/.test(debug_script.name)); |
105 assertEquals(Debug.ScriptType.Normal, debug_script.type); | 105 assertEquals(Debug.ScriptType.Normal, debug_script.type); |
106 | 106 |
107 // Check a nonexistent script. | 107 // Check a nonexistent script. |
108 var dummy_script = Debug.findScript('dummy.js'); | 108 var dummy_script = Debug.findScript('dummy.js'); |
109 assertTrue(typeof dummy_script == 'undefined'); | 109 assertTrue(typeof dummy_script == 'undefined'); |
110 | 110 |
111 Debug.setListener(null); | 111 Debug.setListener(null); |
OLD | NEW |