| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 extension_count++; | 66 extension_count++; |
| 67 } else if (scripts[i].type == Debug.ScriptType.Normal) { | 67 } else if (scripts[i].type == Debug.ScriptType.Normal) { |
| 68 normal_count++; | 68 normal_count++; |
| 69 } else { | 69 } else { |
| 70 assertUnreachable('Unexpected type ' + scripts[i].type); | 70 assertUnreachable('Unexpected type ' + scripts[i].type); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 // This has to be updated if the number of native scripts change. | 74 // This has to be updated if the number of native scripts change. |
| 75 assertEquals(%NativeScriptsCount(), named_native_count); | 75 assertEquals(%NativeScriptsCount(), named_native_count); |
| 76 // Only the 'gc' extension is loaded. | 76 // The 'gc' extension and one extras script is loaded. |
| 77 assertEquals(1, extension_count); | 77 assertEquals(2, extension_count); |
| 78 // This script and mjsunit.js has been loaded. If using d8, d8 loads | 78 // This script and mjsunit.js has been loaded. If using d8, d8 loads |
| 79 // a normal script during startup too. | 79 // a normal script during startup too. |
| 80 assertTrue(normal_count == 2 || normal_count == 3); | 80 assertTrue(normal_count == 2 || normal_count == 3); |
| 81 | 81 |
| 82 // Test a builtins script. | 82 // Test a builtins script. |
| 83 var math_script = Debug.findScript('native math.js'); | 83 var math_script = Debug.findScript('native math.js'); |
| 84 assertEquals('native math.js', math_script.name); | 84 assertEquals('native math.js', math_script.name); |
| 85 assertEquals(Debug.ScriptType.Native, math_script.type); | 85 assertEquals(Debug.ScriptType.Native, math_script.type); |
| 86 | 86 |
| 87 // Test a builtins delay loaded script. | 87 // Test a builtins delay loaded script. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 104 // Test a normal script. | 104 // Test a normal script. |
| 105 var debug_script = Debug.findScript(/debug-script.js/); | 105 var debug_script = Debug.findScript(/debug-script.js/); |
| 106 assertTrue(/debug-script.js/.test(debug_script.name)); | 106 assertTrue(/debug-script.js/.test(debug_script.name)); |
| 107 assertEquals(Debug.ScriptType.Normal, debug_script.type); | 107 assertEquals(Debug.ScriptType.Normal, debug_script.type); |
| 108 | 108 |
| 109 // Check a nonexistent script. | 109 // Check a nonexistent script. |
| 110 var dummy_script = Debug.findScript('dummy.js'); | 110 var dummy_script = Debug.findScript('dummy.js'); |
| 111 assertTrue(typeof dummy_script == 'undefined'); | 111 assertTrue(typeof dummy_script == 'undefined'); |
| 112 | 112 |
| 113 Debug.setListener(null); | 113 Debug.setListener(null); |
| OLD | NEW |