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

Side by Side Diff: third_party/WebKit/Source/web/tests/ChromeClientImplTest.cpp

Issue 2651583007: Plumbing blink::Interface{Provider|Registry} through WebLocalFrame's constructor. (Closed)
Patch Set: Rebasing... Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 class GetNavigationPolicyTest : public testing::Test { 65 class GetNavigationPolicyTest : public testing::Test {
66 public: 66 public:
67 GetNavigationPolicyTest() 67 GetNavigationPolicyTest()
68 : m_result(WebNavigationPolicyIgnore), m_webViewClient(&m_result) {} 68 : m_result(WebNavigationPolicyIgnore), m_webViewClient(&m_result) {}
69 69
70 protected: 70 protected:
71 void SetUp() override { 71 void SetUp() override {
72 m_webView = toWebViewImpl( 72 m_webView = toWebViewImpl(
73 WebView::create(&m_webViewClient, WebPageVisibilityStateVisible)); 73 WebView::create(&m_webViewClient, WebPageVisibilityStateVisible));
74 m_webView->setMainFrame( 74 m_webView->setMainFrame(WebLocalFrame::create(
75 WebLocalFrame::create(WebTreeScopeType::Document, &m_webFrameClient)); 75 WebTreeScopeType::Document, &m_webFrameClient, nullptr, nullptr));
76 m_chromeClientImpl = toChromeClientImpl(&m_webView->page()->chromeClient()); 76 m_chromeClientImpl = toChromeClientImpl(&m_webView->page()->chromeClient());
77 m_result = WebNavigationPolicyIgnore; 77 m_result = WebNavigationPolicyIgnore;
78 } 78 }
79 79
80 void TearDown() override { m_webView->close(); } 80 void TearDown() override { m_webView->close(); }
81 81
82 WebNavigationPolicy getNavigationPolicyWithMouseEvent( 82 WebNavigationPolicy getNavigationPolicyWithMouseEvent(
83 int modifiers, 83 int modifiers,
84 WebMouseEvent::Button button, 84 WebMouseEvent::Button button,
85 bool asPopup) { 85 bool asPopup) {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 private: 246 private:
247 FrameTestHelpers::WebViewHelper m_webViewHelper; 247 FrameTestHelpers::WebViewHelper m_webViewHelper;
248 }; 248 };
249 249
250 class CreateWindowTest : public testing::Test { 250 class CreateWindowTest : public testing::Test {
251 protected: 251 protected:
252 void SetUp() override { 252 void SetUp() override {
253 m_webView = toWebViewImpl( 253 m_webView = toWebViewImpl(
254 WebView::create(&m_webViewClient, WebPageVisibilityStateVisible)); 254 WebView::create(&m_webViewClient, WebPageVisibilityStateVisible));
255 m_mainFrame = 255 m_mainFrame = WebLocalFrame::create(WebTreeScopeType::Document,
256 WebLocalFrame::create(WebTreeScopeType::Document, &m_webFrameClient); 256 &m_webFrameClient, nullptr, nullptr);
257 m_webView->setMainFrame(m_mainFrame); 257 m_webView->setMainFrame(m_mainFrame);
258 m_chromeClientImpl = toChromeClientImpl(&m_webView->page()->chromeClient()); 258 m_chromeClientImpl = toChromeClientImpl(&m_webView->page()->chromeClient());
259 } 259 }
260 260
261 void TearDown() override { m_webView->close(); } 261 void TearDown() override { m_webView->close(); }
262 262
263 ViewCreatingClient m_webViewClient; 263 ViewCreatingClient m_webViewClient;
264 WebViewImpl* m_webView; 264 WebViewImpl* m_webView;
265 WebLocalFrame* m_mainFrame; 265 WebLocalFrame* m_mainFrame;
266 FrameTestHelpers::TestWebFrameClient m_webFrameClient; 266 FrameTestHelpers::TestWebFrameClient m_webFrameClient;
267 Persistent<ChromeClientImpl> m_chromeClientImpl; 267 Persistent<ChromeClientImpl> m_chromeClientImpl;
268 }; 268 };
269 269
270 TEST_F(CreateWindowTest, CreateWindowFromSuspendedPage) { 270 TEST_F(CreateWindowTest, CreateWindowFromSuspendedPage) {
271 ScopedPageSuspender suspender; 271 ScopedPageSuspender suspender;
272 LocalFrame* frame = toWebLocalFrameImpl(m_mainFrame)->frame(); 272 LocalFrame* frame = toWebLocalFrameImpl(m_mainFrame)->frame();
273 FrameLoadRequest request(frame->document()); 273 FrameLoadRequest request(frame->document());
274 WindowFeatures features; 274 WindowFeatures features;
275 EXPECT_EQ(nullptr, 275 EXPECT_EQ(nullptr,
276 m_chromeClientImpl->createWindow(frame, request, features, 276 m_chromeClientImpl->createWindow(frame, request, features,
277 NavigationPolicyNewForegroundTab)); 277 NavigationPolicyNewForegroundTab));
278 } 278 }
279 279
280 } // namespace blink 280 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698