OLD | NEW |
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 "extensions/renderer/module_system_test.h" | 5 #include "extensions/renderer/module_system_test.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 "AssertFalse", | 73 "AssertFalse", |
74 base::Bind(&AssertNatives::AssertFalse, base::Unretained(this))); | 74 base::Bind(&AssertNatives::AssertFalse, base::Unretained(this))); |
75 } | 75 } |
76 | 76 |
77 bool assertion_made() { return assertion_made_; } | 77 bool assertion_made() { return assertion_made_; } |
78 bool failed() { return failed_; } | 78 bool failed() { return failed_; } |
79 | 79 |
80 void AssertTrue(const v8::FunctionCallbackInfo<v8::Value>& args) { | 80 void AssertTrue(const v8::FunctionCallbackInfo<v8::Value>& args) { |
81 CHECK_EQ(1, args.Length()); | 81 CHECK_EQ(1, args.Length()); |
82 assertion_made_ = true; | 82 assertion_made_ = true; |
83 failed_ = failed_ || !args[0]->ToBoolean()->Value(); | 83 failed_ = failed_ || !args[0]->ToBoolean(args.GetIsolate())->Value(); |
84 } | 84 } |
85 | 85 |
86 void AssertFalse(const v8::FunctionCallbackInfo<v8::Value>& args) { | 86 void AssertFalse(const v8::FunctionCallbackInfo<v8::Value>& args) { |
87 CHECK_EQ(1, args.Length()); | 87 CHECK_EQ(1, args.Length()); |
88 assertion_made_ = true; | 88 assertion_made_ = true; |
89 failed_ = failed_ || args[0]->ToBoolean()->Value(); | 89 failed_ = failed_ || args[0]->ToBoolean(args.GetIsolate())->Value(); |
90 } | 90 } |
91 | 91 |
92 private: | 92 private: |
93 bool assertion_made_; | 93 bool assertion_made_; |
94 bool failed_; | 94 bool failed_; |
95 }; | 95 }; |
96 | 96 |
97 // Source map that operates on std::strings. | 97 // Source map that operates on std::strings. |
98 class ModuleSystemTestEnvironment::StringSourceMap | 98 class ModuleSystemTestEnvironment::StringSourceMap |
99 : public ModuleSystem::SourceMap { | 99 : public ModuleSystem::SourceMap { |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 246 |
247 void ModuleSystemTest::ExpectNoAssertionsMade() { | 247 void ModuleSystemTest::ExpectNoAssertionsMade() { |
248 should_assertions_be_made_ = false; | 248 should_assertions_be_made_ = false; |
249 } | 249 } |
250 | 250 |
251 void ModuleSystemTest::RunResolvedPromises() { | 251 void ModuleSystemTest::RunResolvedPromises() { |
252 isolate_->RunMicrotasks(); | 252 isolate_->RunMicrotasks(); |
253 } | 253 } |
254 | 254 |
255 } // namespace extensions | 255 } // namespace extensions |
OLD | NEW |