OLD | NEW |
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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 } | 265 } |
266 | 266 |
267 private: | 267 private: |
268 FrameTestHelpers::WebViewHelper m_webViewHelper; | 268 FrameTestHelpers::WebViewHelper m_webViewHelper; |
269 }; | 269 }; |
270 | 270 |
271 class CreateWindowTest : public testing::Test { | 271 class CreateWindowTest : public testing::Test { |
272 protected: | 272 protected: |
273 void SetUp() override | 273 void SetUp() override |
274 { | 274 { |
275 m_webView = toWebViewImpl(WebView::create(&m_webViewClient, WebPageVisib
ilityStateVisible)); | 275 m_webView = toWebViewImpl(WebView::create(&m_webViewClient)); |
276 m_mainFrame = WebLocalFrame::create(WebTreeScopeType::Document, &m_webFr
ameClient); | 276 m_mainFrame = WebLocalFrame::create(WebTreeScopeType::Document, &m_webFr
ameClient); |
277 m_webView->setMainFrame(m_mainFrame); | 277 m_webView->setMainFrame(m_mainFrame); |
278 m_chromeClientImpl = toChromeClientImpl(&m_webView->page()->chromeClient
()); | 278 m_chromeClientImpl = toChromeClientImpl(&m_webView->page()->chromeClient
()); |
279 } | 279 } |
280 | 280 |
281 void TearDown() override | 281 void TearDown() override |
282 { | 282 { |
283 m_webView->close(); | 283 m_webView->close(); |
284 m_mainFrame->close(); | 284 m_mainFrame->close(); |
285 } | 285 } |
286 | 286 |
287 ViewCreatingClient m_webViewClient; | 287 ViewCreatingClient m_webViewClient; |
288 WebViewImpl* m_webView; | 288 WebViewImpl* m_webView; |
289 WebFrame* m_mainFrame; | 289 WebFrame* m_mainFrame; |
290 FrameTestHelpers::TestWebFrameClient m_webFrameClient; | 290 FrameTestHelpers::TestWebFrameClient m_webFrameClient; |
291 Persistent<ChromeClientImpl> m_chromeClientImpl; | 291 Persistent<ChromeClientImpl> m_chromeClientImpl; |
292 }; | 292 }; |
293 | 293 |
294 TEST_F(CreateWindowTest, CreateWindowFromDeferredPage) | 294 TEST_F(CreateWindowTest, CreateWindowFromDeferredPage) |
295 { | 295 { |
296 m_webView->page()->setDefersLoading(true); | 296 m_webView->page()->setDefersLoading(true); |
297 LocalFrame* frame = toWebLocalFrameImpl(m_mainFrame)->frame(); | 297 LocalFrame* frame = toWebLocalFrameImpl(m_mainFrame)->frame(); |
298 FrameLoadRequest request(frame->document()); | 298 FrameLoadRequest request(frame->document()); |
299 WindowFeatures features; | 299 WindowFeatures features; |
300 EXPECT_EQ(nullptr, m_chromeClientImpl->createWindow(frame, request, features
, NavigationPolicyNewForegroundTab)); | 300 EXPECT_EQ(nullptr, m_chromeClientImpl->createWindow(frame, request, features
, NavigationPolicyNewForegroundTab, MaybeSetOpener)); |
301 m_webView->page()->setDefersLoading(false); | 301 m_webView->page()->setDefersLoading(false); |
302 } | 302 } |
303 | 303 |
304 } // namespace blink | 304 } // namespace blink |
OLD | NEW |