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

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

Issue 1645923002: RenderViewTest: really drain the event loop before shutting down Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « content/public/test/render_view_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #include "content/test/test_render_frame.h" 52 #include "content/test/test_render_frame.h"
53 #include "net/base/net_errors.h" 53 #include "net/base/net_errors.h"
54 #include "net/cert/cert_status_flags.h" 54 #include "net/cert/cert_status_flags.h"
55 #include "testing/gtest/include/gtest/gtest.h" 55 #include "testing/gtest/include/gtest/gtest.h"
56 #include "third_party/WebKit/public/platform/WebData.h" 56 #include "third_party/WebKit/public/platform/WebData.h"
57 #include "third_party/WebKit/public/platform/WebHTTPBody.h" 57 #include "third_party/WebKit/public/platform/WebHTTPBody.h"
58 #include "third_party/WebKit/public/platform/WebString.h" 58 #include "third_party/WebKit/public/platform/WebString.h"
59 #include "third_party/WebKit/public/platform/WebURLResponse.h" 59 #include "third_party/WebKit/public/platform/WebURLResponse.h"
60 #include "third_party/WebKit/public/web/WebDataSource.h" 60 #include "third_party/WebKit/public/web/WebDataSource.h"
61 #include "third_party/WebKit/public/web/WebDeviceEmulationParams.h" 61 #include "third_party/WebKit/public/web/WebDeviceEmulationParams.h"
62 #include "third_party/WebKit/public/web/WebHeap.h"
63 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" 62 #include "third_party/WebKit/public/web/WebHistoryCommitType.h"
64 #include "third_party/WebKit/public/web/WebHistoryItem.h" 63 #include "third_party/WebKit/public/web/WebHistoryItem.h"
65 #include "third_party/WebKit/public/web/WebLocalFrame.h" 64 #include "third_party/WebKit/public/web/WebLocalFrame.h"
66 #include "third_party/WebKit/public/web/WebPerformance.h" 65 #include "third_party/WebKit/public/web/WebPerformance.h"
67 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" 66 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
68 #include "third_party/WebKit/public/web/WebSettings.h" 67 #include "third_party/WebKit/public/web/WebSettings.h"
69 #include "third_party/WebKit/public/web/WebView.h" 68 #include "third_party/WebKit/public/web/WebView.h"
70 #include "third_party/WebKit/public/web/WebWindowFeatures.h" 69 #include "third_party/WebKit/public/web/WebWindowFeatures.h"
71 #include "ui/events/event.h" 70 #include "ui/events/event.h"
72 #include "ui/events/keycodes/keyboard_codes.h" 71 #include "ui/events/keycodes/keyboard_codes.h"
73 #include "ui/gfx/codec/jpeg_codec.h" 72 #include "ui/gfx/codec/jpeg_codec.h"
74 #include "ui/gfx/range/range.h" 73 #include "ui/gfx/range/range.h"
75 74
76 #if defined(USE_AURA) && defined(USE_X11) 75 #if defined(USE_AURA) && defined(USE_X11)
77 #include <X11/Xlib.h> 76 #include <X11/Xlib.h>
78 #include "ui/events/event_constants.h" 77 #include "ui/events/event_constants.h"
79 #include "ui/events/keycodes/keyboard_code_conversion.h" 78 #include "ui/events/keycodes/keyboard_code_conversion.h"
80 #include "ui/events/test/events_test_utils.h" 79 #include "ui/events/test/events_test_utils.h"
81 #include "ui/events/test/events_test_utils_x11.h" 80 #include "ui/events/test/events_test_utils_x11.h"
82 #endif 81 #endif
83 82
84 #if defined(USE_OZONE) 83 #if defined(USE_OZONE)
85 #include "ui/events/keycodes/keyboard_code_conversion.h" 84 #include "ui/events/keycodes/keyboard_code_conversion.h"
86 #endif 85 #endif
87 86
88 #include "url/url_constants.h" 87 #include "url/url_constants.h"
89 88
90 using blink::WebFrame; 89 using blink::WebFrame;
91 using blink::WebHeap;
92 using blink::WebInputEvent; 90 using blink::WebInputEvent;
93 using blink::WebLocalFrame; 91 using blink::WebLocalFrame;
94 using blink::WebMouseEvent; 92 using blink::WebMouseEvent;
95 using blink::WebRuntimeFeatures; 93 using blink::WebRuntimeFeatures;
96 using blink::WebString; 94 using blink::WebString;
97 using blink::WebTextDirection; 95 using blink::WebTextDirection;
98 using blink::WebURLError; 96 using blink::WebURLError;
99 97
100 namespace content { 98 namespace content {
101 99
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 ~RenderViewImplTest() override {} 164 ~RenderViewImplTest() override {}
167 165
168 void SetUp() override { 166 void SetUp() override {
169 // Enable Blink's experimental and test only features so that test code 167 // Enable Blink's experimental and test only features so that test code
170 // does not have to bother enabling each feature. 168 // does not have to bother enabling each feature.
171 WebRuntimeFeatures::enableExperimentalFeatures(true); 169 WebRuntimeFeatures::enableExperimentalFeatures(true);
172 WebRuntimeFeatures::enableTestOnlyFeatures(true); 170 WebRuntimeFeatures::enableTestOnlyFeatures(true);
173 RenderViewTest::SetUp(); 171 RenderViewTest::SetUp();
174 } 172 }
175 173
176 // To avoid flaky leak reports, insist on GCing
177 // Blink upon shutdown to clear out garbage.
178 void TearDown() override {
179 WebHeap::collectGarbageForTesting();
180 RenderViewTest::TearDown();
181 }
182
183 RenderViewImpl* view() { 174 RenderViewImpl* view() {
184 return static_cast<RenderViewImpl*>(view_); 175 return static_cast<RenderViewImpl*>(view_);
185 } 176 }
186 177
187 int view_page_id() { 178 int view_page_id() {
188 return view()->page_id_; 179 return view()->page_id_;
189 } 180 }
190 181
191 TestRenderFrame* frame() { 182 TestRenderFrame* frame() {
192 return static_cast<TestRenderFrame*>(view()->GetMainRenderFrame()); 183 return static_cast<TestRenderFrame*>(view()->GetMainRenderFrame());
(...skipping 2549 matching lines...) Expand 10 before | Expand all | Expand 10 after
2742 FROM_HERE, 2733 FROM_HERE,
2743 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); 2734 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this)));
2744 ExecuteJavaScriptForTests("debugger;"); 2735 ExecuteJavaScriptForTests("debugger;");
2745 2736
2746 // CloseWhilePaused should resume execution and continue here. 2737 // CloseWhilePaused should resume execution and continue here.
2747 EXPECT_FALSE(IsPaused()); 2738 EXPECT_FALSE(IsPaused());
2748 Detach(); 2739 Detach();
2749 } 2740 }
2750 2741
2751 } // namespace content 2742 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/render_view_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698