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 22230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22241 histogramTimer->Start(); | 22241 histogramTimer->Start(); |
22242 CHECK_EQ("V8.Test", last_event_message); | 22242 CHECK_EQ("V8.Test", last_event_message); |
22243 CHECK_EQ(0, last_event_status); | 22243 CHECK_EQ(0, last_event_status); |
22244 histogramTimer->Stop(); | 22244 histogramTimer->Stop(); |
22245 CHECK_EQ("V8.Test", last_event_message); | 22245 CHECK_EQ("V8.Test", last_event_message); |
22246 CHECK_EQ(1, last_event_status); | 22246 CHECK_EQ(1, last_event_status); |
22247 } | 22247 } |
22248 | 22248 |
22249 | 22249 |
22250 TEST(Promises) { | 22250 TEST(Promises) { |
| 22251 i::FLAG_harmony_promises = true; |
| 22252 |
22251 LocalContext context; | 22253 LocalContext context; |
22252 v8::Isolate* isolate = context->GetIsolate(); | 22254 v8::Isolate* isolate = context->GetIsolate(); |
22253 v8::HandleScope scope(isolate); | 22255 v8::HandleScope scope(isolate); |
22254 Handle<Object> global = context->Global(); | 22256 Handle<Object> global = context->Global(); |
22255 | 22257 |
22256 // Creation. | 22258 // Creation. |
22257 Handle<v8::Promise::Resolver> pr = v8::Promise::Resolver::New(isolate); | 22259 Handle<v8::Promise::Resolver> pr = v8::Promise::Resolver::New(isolate); |
22258 Handle<v8::Promise::Resolver> rr = v8::Promise::Resolver::New(isolate); | 22260 Handle<v8::Promise::Resolver> rr = v8::Promise::Resolver::New(isolate); |
22259 Handle<v8::Promise> p = pr->GetPromise(); | 22261 Handle<v8::Promise> p = pr->GetPromise(); |
22260 Handle<v8::Promise> r = rr->GetPromise(); | 22262 Handle<v8::Promise> r = rr->GetPromise(); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22413 "f.call(friend);"); | 22415 "f.call(friend);"); |
22414 CHECK_EQ(2, named_access_count); | 22416 CHECK_EQ(2, named_access_count); |
22415 | 22417 |
22416 // Test access using Object.setPrototypeOf reflective method. | 22418 // Test access using Object.setPrototypeOf reflective method. |
22417 named_access_count = 0; | 22419 named_access_count = 0; |
22418 CompileRun("Object.setPrototypeOf(friend, {});"); | 22420 CompileRun("Object.setPrototypeOf(friend, {});"); |
22419 CHECK_EQ(1, named_access_count); | 22421 CHECK_EQ(1, named_access_count); |
22420 CompileRun("Object.getPrototypeOf(friend);"); | 22422 CompileRun("Object.getPrototypeOf(friend);"); |
22421 CHECK_EQ(2, named_access_count); | 22423 CHECK_EQ(2, named_access_count); |
22422 } | 22424 } |
OLD | NEW |