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

Side by Side Diff: content/renderer/render_view_browsertest.cc

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: Work for some comments Created 3 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
OLDNEW
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <tuple> 7 #include <tuple>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "content/renderer/history_entry.h" 54 #include "content/renderer/history_entry.h"
55 #include "content/renderer/history_serialization.h" 55 #include "content/renderer/history_serialization.h"
56 #include "content/renderer/navigation_state_impl.h" 56 #include "content/renderer/navigation_state_impl.h"
57 #include "content/renderer/render_frame_proxy.h" 57 #include "content/renderer/render_frame_proxy.h"
58 #include "content/renderer/render_process.h" 58 #include "content/renderer/render_process.h"
59 #include "content/renderer/render_view_impl.h" 59 #include "content/renderer/render_view_impl.h"
60 #include "content/shell/browser/shell.h" 60 #include "content/shell/browser/shell.h"
61 #include "content/shell/browser/shell_browser_context.h" 61 #include "content/shell/browser/shell_browser_context.h"
62 #include "content/test/mock_keyboard.h" 62 #include "content/test/mock_keyboard.h"
63 #include "content/test/test_render_frame.h" 63 #include "content/test/test_render_frame.h"
64 #include "gin/v8_initializer.h"
64 #include "net/base/net_errors.h" 65 #include "net/base/net_errors.h"
65 #include "net/cert/cert_status_flags.h" 66 #include "net/cert/cert_status_flags.h"
66 #include "testing/gtest/include/gtest/gtest.h" 67 #include "testing/gtest/include/gtest/gtest.h"
67 #include "third_party/WebKit/public/platform/WebData.h" 68 #include "third_party/WebKit/public/platform/WebData.h"
68 #include "third_party/WebKit/public/platform/WebHTTPBody.h" 69 #include "third_party/WebKit/public/platform/WebHTTPBody.h"
69 #include "third_party/WebKit/public/platform/WebString.h" 70 #include "third_party/WebKit/public/platform/WebString.h"
70 #include "third_party/WebKit/public/platform/WebURLResponse.h" 71 #include "third_party/WebKit/public/platform/WebURLResponse.h"
71 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerNetworkProvider.h" 72 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerNetworkProvider.h"
72 #include "third_party/WebKit/public/web/WebDataSource.h" 73 #include "third_party/WebKit/public/web/WebDataSource.h"
73 #include "third_party/WebKit/public/web/WebDeviceEmulationParams.h" 74 #include "third_party/WebKit/public/web/WebDeviceEmulationParams.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 return params; 213 return params;
213 } 214 }
214 215
215 } // namespace 216 } // namespace
216 217
217 class RenderViewImplTest : public RenderViewTest { 218 class RenderViewImplTest : public RenderViewTest {
218 public: 219 public:
219 RenderViewImplTest() { 220 RenderViewImplTest() {
220 // Attach a pseudo keyboard device to this object. 221 // Attach a pseudo keyboard device to this object.
221 mock_keyboard_.reset(new MockKeyboard()); 222 mock_keyboard_.reset(new MockKeyboard());
223 gin::V8Initializer::LoadV8Context();
222 } 224 }
223 225
224 ~RenderViewImplTest() override {} 226 ~RenderViewImplTest() override {}
225 227
226 void SetUp() override { 228 void SetUp() override {
227 // Enable Blink's experimental and test only features so that test code 229 // Enable Blink's experimental and test only features so that test code
228 // does not have to bother enabling each feature. 230 // does not have to bother enabling each feature.
229 WebRuntimeFeatures::EnableExperimentalFeatures(true); 231 WebRuntimeFeatures::EnableExperimentalFeatures(true);
230 WebRuntimeFeatures::EnableTestOnlyFeatures(true); 232 WebRuntimeFeatures::EnableTestOnlyFeatures(true);
231 WebRuntimeFeatures::EnableOverlayScrollbars( 233 WebRuntimeFeatures::EnableOverlayScrollbars(
(...skipping 2359 matching lines...) Expand 10 before | Expand all | Expand 10 after
2591 ExpectPauseAndResume(3); 2593 ExpectPauseAndResume(3);
2592 blink::WebScriptSource source2( 2594 blink::WebScriptSource source2(
2593 WebString::FromUTF8("function func2() { func1(); }; func2();")); 2595 WebString::FromUTF8("function func2() { func1(); }; func2();"));
2594 frame()->GetWebFrame()->ExecuteScriptInIsolatedWorld(17, &source2, 1); 2596 frame()->GetWebFrame()->ExecuteScriptInIsolatedWorld(17, &source2, 1);
2595 2597
2596 EXPECT_FALSE(IsPaused()); 2598 EXPECT_FALSE(IsPaused());
2597 Detach(); 2599 Detach();
2598 } 2600 }
2599 2601
2600 } // namespace content 2602 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698