Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: gin/per_context_data_unittest.cc

Issue 1112923003: Replace Handle<> with Local in remaining gin/* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gin/per_context_data.cc ('k') | gin/public/context_holder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gin/per_context_data.h" 5 #include "gin/per_context_data.h"
6 6
7 #include "gin/public/context_holder.h" 7 #include "gin/public/context_holder.h"
8 #include "gin/public/isolate_holder.h" 8 #include "gin/public/isolate_holder.h"
9 #include "gin/test/v8_test.h" 9 #include "gin/test/v8_test.h"
10 #include "v8/include/v8.h" 10 #include "v8/include/v8.h"
11 11
12 namespace gin { 12 namespace gin {
13 13
14 typedef V8Test PerContextDataTest; 14 typedef V8Test PerContextDataTest;
15 15
16 // Verifies PerContextData can be looked up by context and that it is not 16 // Verifies PerContextData can be looked up by context and that it is not
17 // available once ContextHolder is destroyed. 17 // available once ContextHolder is destroyed.
18 TEST_F(PerContextDataTest, LookupAndDestruction) { 18 TEST_F(PerContextDataTest, LookupAndDestruction) {
19 v8::Isolate::Scope isolate_scope(instance_->isolate()); 19 v8::Isolate::Scope isolate_scope(instance_->isolate());
20 v8::HandleScope handle_scope(instance_->isolate()); 20 v8::HandleScope handle_scope(instance_->isolate());
21 v8::Handle<v8::Context> context = v8::Context::New( 21 v8::Local<v8::Context> context = v8::Context::New(
22 instance_->isolate(), NULL, v8::Handle<v8::ObjectTemplate>()); 22 instance_->isolate(), NULL, v8::Local<v8::ObjectTemplate>());
23 { 23 {
24 ContextHolder context_holder(instance_->isolate()); 24 ContextHolder context_holder(instance_->isolate());
25 context_holder.SetContext(context); 25 context_holder.SetContext(context);
26 PerContextData* per_context_data = PerContextData::From(context); 26 PerContextData* per_context_data = PerContextData::From(context);
27 EXPECT_TRUE(per_context_data != NULL); 27 EXPECT_TRUE(per_context_data != NULL);
28 EXPECT_EQ(&context_holder, per_context_data->context_holder()); 28 EXPECT_EQ(&context_holder, per_context_data->context_holder());
29 } 29 }
30 PerContextData* per_context_data = PerContextData::From(context); 30 PerContextData* per_context_data = PerContextData::From(context);
31 EXPECT_TRUE(per_context_data == NULL); 31 EXPECT_TRUE(per_context_data == NULL);
32 } 32 }
33 33
34 } // namespace gin 34 } // namespace gin
OLDNEW
« no previous file with comments | « gin/per_context_data.cc ('k') | gin/public/context_holder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698