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

Unified Diff: extensions/renderer/module_system_unittest.cc

Issue 1185443004: extensions: Use V8 Maybe APIs in ModuleSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/renderer/module_system_test.cc ('k') | extensions/renderer/v8_helpers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/module_system_unittest.cc
diff --git a/extensions/renderer/module_system_unittest.cc b/extensions/renderer/module_system_unittest.cc
index e687841d9d120b48fb7a5daa235ccdabfd16f22e..c5c916eb103f0c4e6ecf7d528441b425bad8303a 100644
--- a/extensions/renderer/module_system_unittest.cc
+++ b/extensions/renderer/module_system_unittest.cc
@@ -34,7 +34,8 @@ class CounterNatives : public ObjectBackedNativeHandler {
class TestExceptionHandler : public ModuleSystem::ExceptionHandler {
public:
- TestExceptionHandler() : handled_exception_(false) {}
+ TestExceptionHandler()
+ : ModuleSystem::ExceptionHandler(nullptr), handled_exception_(false) {}
void HandleUncaughtException(const v8::TryCatch& try_catch) override {
handled_exception_ = true;
@@ -404,11 +405,14 @@ TEST_F(ModuleSystemTest, TestRequireAsyncFromAnotherContext) {
" return 'pong';"
" }"
"});");
- gin::ModuleRegistry::From(env()->context()->v8_context())->AddBuiltinModule(
- env()->isolate(), "natives", other_env->module_system()->NewInstance());
+ gin::ModuleRegistry::From(env()->context()->v8_context())
+ ->AddBuiltinModule(
+ env()->isolate(), "natives",
+ other_env->module_system()->NewInstance());
gin::ModuleRegistry::From(other_env->context()->v8_context())
->AddBuiltinModule(
- env()->isolate(), "natives", env()->module_system()->NewInstance());
+ env()->isolate(), "natives",
+ env()->module_system()->NewInstance());
env()->module_system()->Require("test");
RunResolvedPromises();
}
@@ -438,11 +442,14 @@ TEST_F(ModuleSystemTest, TestRequireAsyncBetweenContexts) {
" return natives.requireAsync('pong');"
" }"
"});");
- gin::ModuleRegistry::From(env()->context()->v8_context())->AddBuiltinModule(
- env()->isolate(), "natives", other_env->module_system()->NewInstance());
+ gin::ModuleRegistry::From(env()->context()->v8_context())
+ ->AddBuiltinModule(
+ env()->isolate(), "natives",
+ other_env->module_system()->NewInstance());
gin::ModuleRegistry::From(other_env->context()->v8_context())
->AddBuiltinModule(
- env()->isolate(), "natives", env()->module_system()->NewInstance());
+ env()->isolate(), "natives",
+ env()->module_system()->NewInstance());
env()->module_system()->Require("test");
RunResolvedPromises();
}
@@ -461,8 +468,10 @@ TEST_F(ModuleSystemTest, TestRequireAsyncFromContextWithNoModuleRegistry) {
" });"
"});");
scoped_ptr<ModuleSystemTestEnvironment> other_env = CreateEnvironment();
- gin::ModuleRegistry::From(env()->context()->v8_context())->AddBuiltinModule(
- env()->isolate(), "natives", other_env->module_system()->NewInstance());
+ gin::ModuleRegistry::From(env()->context()->v8_context())
+ ->AddBuiltinModule(
+ env()->isolate(), "natives",
+ other_env->module_system()->NewInstance());
other_env->ShutdownGin();
env()->module_system()->Require("test");
RunResolvedPromises();
@@ -477,8 +486,10 @@ TEST_F(ModuleSystemTest, TestRequireAsyncFromContextWithNoModuleSystem) {
" natives.requireAsync('foo') === undefined);"
"});");
scoped_ptr<ModuleSystemTestEnvironment> other_env = CreateEnvironment();
- gin::ModuleRegistry::From(env()->context()->v8_context())->AddBuiltinModule(
- env()->isolate(), "natives", other_env->module_system()->NewInstance());
+ gin::ModuleRegistry::From(env()->context()->v8_context())
+ ->AddBuiltinModule(
+ env()->isolate(), "natives",
+ other_env->module_system()->NewInstance());
other_env->ShutdownModuleSystem();
env()->module_system()->Require("test");
RunResolvedPromises();
« no previous file with comments | « extensions/renderer/module_system_test.cc ('k') | extensions/renderer/v8_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698