OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/pepper/v8_var_converter.h" | 5 #include "content/renderer/pepper/v8_var_converter.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 converter_.reset(new V8VarConverter( | 158 converter_.reset(new V8VarConverter( |
159 dummy, | 159 dummy, |
160 scoped_ptr<ResourceConverter>(new MockResourceConverter).Pass())); | 160 scoped_ptr<ResourceConverter>(new MockResourceConverter).Pass())); |
161 } | 161 } |
162 virtual ~V8VarConverterTest() {} | 162 virtual ~V8VarConverterTest() {} |
163 | 163 |
164 // testing::Test implementation. | 164 // testing::Test implementation. |
165 virtual void SetUp() { | 165 virtual void SetUp() { |
166 ProxyLock::Acquire(); | 166 ProxyLock::Acquire(); |
167 v8::HandleScope handle_scope(isolate_); | 167 v8::HandleScope handle_scope(isolate_); |
168 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); | 168 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate_); |
169 context_.Reset(isolate_, v8::Context::New(isolate_, NULL, global)); | 169 context_.Reset(isolate_, v8::Context::New(isolate_, NULL, global)); |
170 } | 170 } |
171 virtual void TearDown() { | 171 virtual void TearDown() { |
172 context_.Reset(); | 172 context_.Reset(); |
173 ASSERT_TRUE(PpapiGlobals::Get()->GetVarTracker()->GetLiveVars().empty()); | 173 ASSERT_TRUE(PpapiGlobals::Get()->GetVarTracker()->GetLiveVars().empty()); |
174 ProxyLock::Release(); | 174 ProxyLock::Release(); |
175 } | 175 } |
176 | 176 |
177 protected: | 177 protected: |
178 bool FromV8ValueSync(v8::Handle<v8::Value> val, | 178 bool FromV8ValueSync(v8::Handle<v8::Value> val, |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 ScopedPPVar oops(ScopedPPVar::PassRef(), StringVar::StringToPPVar("oops")); | 437 ScopedPPVar oops(ScopedPPVar::PassRef(), StringVar::StringToPPVar("oops")); |
438 expected->SetWithStringKey("undefined", oops.get()); | 438 expected->SetWithStringKey("undefined", oops.get()); |
439 ScopedPPVar release_expected( | 439 ScopedPPVar release_expected( |
440 ScopedPPVar::PassRef(), expected->GetPPVar()); | 440 ScopedPPVar::PassRef(), expected->GetPPVar()); |
441 | 441 |
442 ASSERT_TRUE(TestEqual(release_expected.get(), release_actual.get())); | 442 ASSERT_TRUE(TestEqual(release_expected.get(), release_actual.get())); |
443 } | 443 } |
444 } | 444 } |
445 | 445 |
446 } // namespace content | 446 } // namespace content |
OLD | NEW |