OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 23631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
23642 void StoringEventLoggerCallback(const char* message, int status) { | 23642 void StoringEventLoggerCallback(const char* message, int status) { |
23643 last_event_message = message; | 23643 last_event_message = message; |
23644 last_event_status = status; | 23644 last_event_status = status; |
23645 } | 23645 } |
23646 | 23646 |
23647 | 23647 |
23648 TEST(EventLogging) { | 23648 TEST(EventLogging) { |
23649 v8::Isolate* isolate = CcTest::isolate(); | 23649 v8::Isolate* isolate = CcTest::isolate(); |
23650 isolate->SetEventLogger(StoringEventLoggerCallback); | 23650 isolate->SetEventLogger(StoringEventLoggerCallback); |
23651 v8::internal::HistogramTimer histogramTimer( | 23651 v8::internal::HistogramTimer histogramTimer( |
23652 "V8.Test", 0, 10000, 50, | 23652 "V8.Test", 0, 10000, v8::internal::HistogramTimer::MILLISECOND, 50, |
23653 reinterpret_cast<v8::internal::Isolate*>(isolate)); | 23653 reinterpret_cast<v8::internal::Isolate*>(isolate)); |
23654 histogramTimer.Start(); | 23654 histogramTimer.Start(); |
23655 CHECK_EQ("V8.Test", last_event_message); | 23655 CHECK_EQ("V8.Test", last_event_message); |
23656 CHECK_EQ(0, last_event_status); | 23656 CHECK_EQ(0, last_event_status); |
23657 histogramTimer.Stop(); | 23657 histogramTimer.Stop(); |
23658 CHECK_EQ("V8.Test", last_event_message); | 23658 CHECK_EQ("V8.Test", last_event_message); |
23659 CHECK_EQ(1, last_event_status); | 23659 CHECK_EQ(1, last_event_status); |
23660 } | 23660 } |
23661 | 23661 |
23662 | 23662 |
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
24766 "bar2.js"); | 24766 "bar2.js"); |
24767 } | 24767 } |
24768 | 24768 |
24769 | 24769 |
24770 TEST(StreamingScriptWithSourceMappingURLInTheMiddle) { | 24770 TEST(StreamingScriptWithSourceMappingURLInTheMiddle) { |
24771 const char* chunks[] = {"function foo() { ret", "urn 13; }\n//#", | 24771 const char* chunks[] = {"function foo() { ret", "urn 13; }\n//#", |
24772 " sourceMappingURL=bar2.js\n", "foo();", NULL}; | 24772 " sourceMappingURL=bar2.js\n", "foo();", NULL}; |
24773 RunStreamingTest(chunks, v8::ScriptCompiler::StreamedSource::UTF8, true, NULL, | 24773 RunStreamingTest(chunks, v8::ScriptCompiler::StreamedSource::UTF8, true, NULL, |
24774 "bar2.js"); | 24774 "bar2.js"); |
24775 } | 24775 } |
OLD | NEW |