| 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 22122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22133 histogramTimer->Start(); | 22133 histogramTimer->Start(); |
| 22134 CHECK_EQ("V8.Test", last_event_message); | 22134 CHECK_EQ("V8.Test", last_event_message); |
| 22135 CHECK_EQ(0, last_event_status); | 22135 CHECK_EQ(0, last_event_status); |
| 22136 histogramTimer->Stop(); | 22136 histogramTimer->Stop(); |
| 22137 CHECK_EQ("V8.Test", last_event_message); | 22137 CHECK_EQ("V8.Test", last_event_message); |
| 22138 CHECK_EQ(1, last_event_status); | 22138 CHECK_EQ(1, last_event_status); |
| 22139 } | 22139 } |
| 22140 | 22140 |
| 22141 | 22141 |
| 22142 TEST(Promises) { | 22142 TEST(Promises) { |
| 22143 i::FLAG_harmony_promises = true; | |
| 22144 | |
| 22145 LocalContext context; | 22143 LocalContext context; |
| 22146 v8::Isolate* isolate = context->GetIsolate(); | 22144 v8::Isolate* isolate = context->GetIsolate(); |
| 22147 v8::HandleScope scope(isolate); | 22145 v8::HandleScope scope(isolate); |
| 22148 Handle<Object> global = context->Global(); | 22146 Handle<Object> global = context->Global(); |
| 22149 | 22147 |
| 22150 // Creation. | 22148 // Creation. |
| 22151 Handle<v8::Promise::Resolver> pr = v8::Promise::Resolver::New(isolate); | 22149 Handle<v8::Promise::Resolver> pr = v8::Promise::Resolver::New(isolate); |
| 22152 Handle<v8::Promise::Resolver> rr = v8::Promise::Resolver::New(isolate); | 22150 Handle<v8::Promise::Resolver> rr = v8::Promise::Resolver::New(isolate); |
| 22153 Handle<v8::Promise> p = pr->GetPromise(); | 22151 Handle<v8::Promise> p = pr->GetPromise(); |
| 22154 Handle<v8::Promise> r = rr->GetPromise(); | 22152 Handle<v8::Promise> r = rr->GetPromise(); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22307 "f.call(friend);"); | 22305 "f.call(friend);"); |
| 22308 CHECK_EQ(2, named_access_count); | 22306 CHECK_EQ(2, named_access_count); |
| 22309 | 22307 |
| 22310 // Test access using Object.setPrototypeOf reflective method. | 22308 // Test access using Object.setPrototypeOf reflective method. |
| 22311 named_access_count = 0; | 22309 named_access_count = 0; |
| 22312 CompileRun("Object.setPrototypeOf(friend, {});"); | 22310 CompileRun("Object.setPrototypeOf(friend, {});"); |
| 22313 CHECK_EQ(1, named_access_count); | 22311 CHECK_EQ(1, named_access_count); |
| 22314 CompileRun("Object.getPrototypeOf(friend);"); | 22312 CompileRun("Object.getPrototypeOf(friend);"); |
| 22315 CHECK_EQ(2, named_access_count); | 22313 CHECK_EQ(2, named_access_count); |
| 22316 } | 22314 } |
| OLD | NEW |