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

Side by Side Diff: extensions/renderer/activity_log_converter_strategy_unittest.cc

Issue 1765423004: Revert of Use v8::MicrotasksScope internally in V8RecursionScope. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8rs-2-endofscope
Patch Set: Created 4 years, 9 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
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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/values.h" 6 #include "base/values.h"
7 #include "extensions/renderer/activity_log_converter_strategy.h" 7 #include "extensions/renderer/activity_log_converter_strategy.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
10 #include "v8/include/v8.h" 9 #include "v8/include/v8.h"
11 10
12 using content::V8ValueConverter; 11 using content::V8ValueConverter;
13 12
14 namespace extensions { 13 namespace extensions {
15 14
16 class ActivityLogConverterStrategyTest : public testing::Test { 15 class ActivityLogConverterStrategyTest : public testing::Test {
17 public: 16 public:
18 ActivityLogConverterStrategyTest() 17 ActivityLogConverterStrategyTest()
19 : isolate_(v8::Isolate::GetCurrent()), 18 : isolate_(v8::Isolate::GetCurrent()),
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 "hot: \"dog\"," 115 "hot: \"dog\","
117 "}," 116 "},"
118 "empty_dictionary: {}," 117 "empty_dictionary: {},"
119 "list: [ \"monkey\", \"balls\" ]," 118 "list: [ \"monkey\", \"balls\" ],"
120 "empty_list: []," 119 "empty_list: [],"
121 "function: (0, function() {})," // ensure function is anonymous 120 "function: (0, function() {})," // ensure function is anonymous
122 "named_function: foo" 121 "named_function: foo"
123 "};" 122 "};"
124 "})();"; 123 "})();";
125 124
126 blink::WebScopedMicrotaskSuppression microtasks_scope;
127 v8::Local<v8::Script> script( 125 v8::Local<v8::Script> script(
128 v8::Script::Compile(v8::String::NewFromUtf8(isolate_, source))); 126 v8::Script::Compile(v8::String::NewFromUtf8(isolate_, source)));
129 v8::Local<v8::Object> v8_object = script->Run().As<v8::Object>(); 127 v8::Local<v8::Object> v8_object = script->Run().As<v8::Object>();
130 128
131 EXPECT_TRUE(VerifyString(v8_object, "[Object]")); 129 EXPECT_TRUE(VerifyString(v8_object, "[Object]"));
132 EXPECT_TRUE( 130 EXPECT_TRUE(
133 VerifyNull(v8_object->Get(v8::String::NewFromUtf8(isolate_, "null")))); 131 VerifyNull(v8_object->Get(v8::String::NewFromUtf8(isolate_, "null"))));
134 EXPECT_TRUE(VerifyBoolean( 132 EXPECT_TRUE(VerifyBoolean(
135 v8_object->Get(v8::String::NewFromUtf8(isolate_, "true")), true)); 133 v8_object->Get(v8::String::NewFromUtf8(isolate_, "true")), true));
136 EXPECT_TRUE(VerifyBoolean( 134 EXPECT_TRUE(VerifyBoolean(
(...skipping 26 matching lines...) Expand all
163 "[Array]")); 161 "[Array]"));
164 EXPECT_TRUE(VerifyString( 162 EXPECT_TRUE(VerifyString(
165 v8_object->Get(v8::String::NewFromUtf8(isolate_, "function")), 163 v8_object->Get(v8::String::NewFromUtf8(isolate_, "function")),
166 "[Function]")); 164 "[Function]"));
167 EXPECT_TRUE(VerifyString( 165 EXPECT_TRUE(VerifyString(
168 v8_object->Get(v8::String::NewFromUtf8(isolate_, "named_function")), 166 v8_object->Get(v8::String::NewFromUtf8(isolate_, "named_function")),
169 "[Function foo()]")); 167 "[Function foo()]"));
170 } 168 }
171 169
172 } // namespace extensions 170 } // namespace extensions
OLDNEW
« no previous file with comments | « content/renderer/pepper/v8_var_converter_unittest.cc ('k') | extensions/renderer/api_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698