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 22173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22184 histogramTimer->Start(); | 22184 histogramTimer->Start(); |
22185 CHECK_EQ("V8.Test", last_event_message); | 22185 CHECK_EQ("V8.Test", last_event_message); |
22186 CHECK_EQ(0, last_event_status); | 22186 CHECK_EQ(0, last_event_status); |
22187 histogramTimer->Stop(); | 22187 histogramTimer->Stop(); |
22188 CHECK_EQ("V8.Test", last_event_message); | 22188 CHECK_EQ("V8.Test", last_event_message); |
22189 CHECK_EQ(1, last_event_status); | 22189 CHECK_EQ(1, last_event_status); |
22190 } | 22190 } |
22191 | 22191 |
22192 | 22192 |
22193 TEST(Promises) { | 22193 TEST(Promises) { |
| 22194 i::FLAG_harmony_promises = true; |
| 22195 |
22194 LocalContext context; | 22196 LocalContext context; |
22195 v8::Isolate* isolate = context->GetIsolate(); | 22197 v8::Isolate* isolate = context->GetIsolate(); |
22196 v8::HandleScope scope(isolate); | 22198 v8::HandleScope scope(isolate); |
22197 Handle<Object> global = context->Global(); | 22199 Handle<Object> global = context->Global(); |
22198 | 22200 |
22199 // Creation. | 22201 // Creation. |
22200 Handle<v8::Promise::Resolver> pr = v8::Promise::Resolver::New(isolate); | 22202 Handle<v8::Promise::Resolver> pr = v8::Promise::Resolver::New(isolate); |
22201 Handle<v8::Promise::Resolver> rr = v8::Promise::Resolver::New(isolate); | 22203 Handle<v8::Promise::Resolver> rr = v8::Promise::Resolver::New(isolate); |
22202 Handle<v8::Promise> p = pr->GetPromise(); | 22204 Handle<v8::Promise> p = pr->GetPromise(); |
22203 Handle<v8::Promise> r = rr->GetPromise(); | 22205 Handle<v8::Promise> r = rr->GetPromise(); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22356 "f.call(friend);"); | 22358 "f.call(friend);"); |
22357 CHECK_EQ(2, named_access_count); | 22359 CHECK_EQ(2, named_access_count); |
22358 | 22360 |
22359 // Test access using Object.setPrototypeOf reflective method. | 22361 // Test access using Object.setPrototypeOf reflective method. |
22360 named_access_count = 0; | 22362 named_access_count = 0; |
22361 CompileRun("Object.setPrototypeOf(friend, {});"); | 22363 CompileRun("Object.setPrototypeOf(friend, {});"); |
22362 CHECK_EQ(1, named_access_count); | 22364 CHECK_EQ(1, named_access_count); |
22363 CompileRun("Object.getPrototypeOf(friend);"); | 22365 CompileRun("Object.getPrototypeOf(friend);"); |
22364 CHECK_EQ(2, named_access_count); | 22366 CHECK_EQ(2, named_access_count); |
22365 } | 22367 } |
OLD | NEW |