OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "bin/builtin.h" | 5 #include "bin/builtin.h" |
6 #include "include/dart_api.h" | 6 #include "include/dart_api.h" |
7 #include "include/dart_mirrors_api.h" | 7 #include "include/dart_mirrors_api.h" |
8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 #include "include/dart_tools_api.h" | 9 #include "include/dart_tools_api.h" |
10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
(...skipping 7820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7831 ASSERT(interrupt_count < kInterruptCount); | 7831 ASSERT(interrupt_count < kInterruptCount); |
7832 return true; | 7832 return true; |
7833 } | 7833 } |
7834 | 7834 |
7835 | 7835 |
7836 TEST_CASE(IsolateInterrupt) { | 7836 TEST_CASE(IsolateInterrupt) { |
7837 Dart_IsolateInterruptCallback saved = Isolate::InterruptCallback(); | 7837 Dart_IsolateInterruptCallback saved = Isolate::InterruptCallback(); |
7838 Isolate::SetInterruptCallback(IsolateInterruptTestCallback); | 7838 Isolate::SetInterruptCallback(IsolateInterruptTestCallback); |
7839 | 7839 |
7840 sync = new Monitor(); | 7840 sync = new Monitor(); |
7841 int result = OSThread::Start(BusyLoop_start, 0); | 7841 int result = OSThread::Start("IsolateInterrupt", BusyLoop_start, 0); |
7842 EXPECT_EQ(0, result); | 7842 EXPECT_EQ(0, result); |
7843 | 7843 |
7844 { | 7844 { |
7845 MonitorLocker ml(sync); | 7845 MonitorLocker ml(sync); |
7846 // Wait for the other isolate to enter main. | 7846 // Wait for the other isolate to enter main. |
7847 while (!main_entered) { | 7847 while (!main_entered) { |
7848 ml.Wait(); | 7848 ml.Wait(); |
7849 } | 7849 } |
7850 } | 7850 } |
7851 | 7851 |
(...skipping 1991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9843 | 9843 |
9844 // Heartbeat test for new events. | 9844 // Heartbeat test for new events. |
9845 EXPECT_SUBSTRING("\"name\":\"TestVMDuration2\"", buffer); | 9845 EXPECT_SUBSTRING("\"name\":\"TestVMDuration2\"", buffer); |
9846 EXPECT_SUBSTRING("\"function\":\"::_bar\"", buffer); | 9846 EXPECT_SUBSTRING("\"function\":\"::_bar\"", buffer); |
9847 | 9847 |
9848 // Free buffer allocated by AppendStreamConsumer | 9848 // Free buffer allocated by AppendStreamConsumer |
9849 free(data.buffer); | 9849 free(data.buffer); |
9850 } | 9850 } |
9851 | 9851 |
9852 } // namespace dart | 9852 } // namespace dart |
OLD | NEW |