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

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

Issue 2714813003: Add an identity component for unique/opaque url::Origins.
Patch Set: Switch to base::UnguessableToken, add to SecurityOrigin. No conversions yet. 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
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp ('k') | url/origin.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 8453 matching lines...) Expand 10 before | Expand all | Expand 10 after
8464 8464
8465 // Make sure that an embedder-triggered detach with a remote frame parent 8465 // Make sure that an embedder-triggered detach with a remote frame parent
8466 // doesn't leave behind dangling pointers. 8466 // doesn't leave behind dangling pointers.
8467 TEST_P(ParameterizedWebFrameTest, EmbedderTriggeredDetachWithRemoteMainFrame) { 8467 TEST_P(ParameterizedWebFrameTest, EmbedderTriggeredDetachWithRemoteMainFrame) {
8468 // FIXME: Refactor some of this logic into WebViewHelper to make it easier to 8468 // FIXME: Refactor some of this logic into WebViewHelper to make it easier to
8469 // write tests with a top-level remote frame. 8469 // write tests with a top-level remote frame.
8470 FrameTestHelpers::TestWebViewClient viewClient; 8470 FrameTestHelpers::TestWebViewClient viewClient;
8471 FrameTestHelpers::TestWebRemoteFrameClient remoteClient; 8471 FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
8472 WebView* view = WebView::create(&viewClient, WebPageVisibilityStateVisible); 8472 WebView* view = WebView::create(&viewClient, WebPageVisibilityStateVisible);
8473 view->setMainFrame(remoteClient.frame()); 8473 view->setMainFrame(remoteClient.frame());
8474 remoteClient.frame()->setReplicatedOrigin(WebSecurityOrigin::createUnique());
8474 WebLocalFrame* childFrame = 8475 WebLocalFrame* childFrame =
8475 FrameTestHelpers::createLocalChild(view->mainFrame()->toWebRemoteFrame()); 8476 FrameTestHelpers::createLocalChild(view->mainFrame()->toWebRemoteFrame());
8476 8477
8477 // Purposely keep the LocalFrame alive so it's the last thing to be destroyed. 8478 // Purposely keep the LocalFrame alive so it's the last thing to be destroyed.
8478 Persistent<Frame> childCoreFrame = childFrame->toImplBase()->frame(); 8479 Persistent<Frame> childCoreFrame = childFrame->toImplBase()->frame();
8479 view->close(); 8480 view->close();
8480 childCoreFrame.clear(); 8481 childCoreFrame.clear();
8481 } 8482 }
8482 8483
8483 class WebFrameSwapTest : public WebFrameTest { 8484 class WebFrameSwapTest : public WebFrameTest {
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
9367 private: 9368 private:
9368 bool m_didHandleGestureEvent; 9369 bool m_didHandleGestureEvent;
9369 }; 9370 };
9370 9371
9371 TEST_P(ParameterizedWebFrameTest, FrameWidgetTest) { 9372 TEST_P(ParameterizedWebFrameTest, FrameWidgetTest) {
9372 FrameTestHelpers::TestWebViewClient viewClient; 9373 FrameTestHelpers::TestWebViewClient viewClient;
9373 WebView* view = WebView::create(&viewClient, WebPageVisibilityStateVisible); 9374 WebView* view = WebView::create(&viewClient, WebPageVisibilityStateVisible);
9374 9375
9375 FrameTestHelpers::TestWebRemoteFrameClient remoteClient; 9376 FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
9376 view->setMainFrame(remoteClient.frame()); 9377 view->setMainFrame(remoteClient.frame());
9378 remoteClient.frame()->setReplicatedOrigin(WebSecurityOrigin::createUnique());
9377 9379
9378 GestureEventTestWebWidgetClient childWidgetClient; 9380 GestureEventTestWebWidgetClient childWidgetClient;
9379 WebLocalFrame* childFrame = FrameTestHelpers::createLocalChild( 9381 WebLocalFrame* childFrame = FrameTestHelpers::createLocalChild(
9380 view->mainFrame()->toWebRemoteFrame(), WebString(), nullptr, 9382 view->mainFrame()->toWebRemoteFrame(), WebString(), nullptr,
9381 &childWidgetClient); 9383 &childWidgetClient);
9382 9384
9383 view->resize(WebSize(1000, 1000)); 9385 view->resize(WebSize(1000, 1000));
9384 9386
9385 childFrame->frameWidget()->handleInputEvent(fatTap(20, 20)); 9387 childFrame->frameWidget()->handleInputEvent(fatTap(20, 20));
9386 EXPECT_TRUE(childWidgetClient.didHandleGestureEvent()); 9388 EXPECT_TRUE(childWidgetClient.didHandleGestureEvent());
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
9615 m_webViewHelper.webView()->enableDeviceEmulation(params); 9617 m_webViewHelper.webView()->enableDeviceEmulation(params);
9616 EXPECT_EQ("20x20", dumpSize("pointer")); 9618 EXPECT_EQ("20x20", dumpSize("pointer"));
9617 m_webViewHelper.webView()->disableDeviceEmulation(); 9619 m_webViewHelper.webView()->disableDeviceEmulation();
9618 } 9620 }
9619 9621
9620 TEST_P(ParameterizedWebFrameTest, CreateLocalChildWithPreviousSibling) { 9622 TEST_P(ParameterizedWebFrameTest, CreateLocalChildWithPreviousSibling) {
9621 FrameTestHelpers::TestWebViewClient viewClient; 9623 FrameTestHelpers::TestWebViewClient viewClient;
9622 FrameTestHelpers::TestWebRemoteFrameClient remoteClient; 9624 FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
9623 WebView* view = WebView::create(&viewClient, WebPageVisibilityStateVisible); 9625 WebView* view = WebView::create(&viewClient, WebPageVisibilityStateVisible);
9624 view->setMainFrame(remoteClient.frame()); 9626 view->setMainFrame(remoteClient.frame());
9627 remoteClient.frame()->setReplicatedOrigin(WebSecurityOrigin::createUnique());
9625 WebRemoteFrame* parent = view->mainFrame()->toWebRemoteFrame(); 9628 WebRemoteFrame* parent = view->mainFrame()->toWebRemoteFrame();
9626 9629
9627 WebLocalFrame* secondFrame( 9630 WebLocalFrame* secondFrame(
9628 FrameTestHelpers::createLocalChild(parent, "name2")); 9631 FrameTestHelpers::createLocalChild(parent, "name2"));
9629 WebLocalFrame* fourthFrame(FrameTestHelpers::createLocalChild( 9632 WebLocalFrame* fourthFrame(FrameTestHelpers::createLocalChild(
9630 parent, "name4", nullptr, nullptr, secondFrame)); 9633 parent, "name4", nullptr, nullptr, secondFrame));
9631 WebLocalFrame* thirdFrame(FrameTestHelpers::createLocalChild( 9634 WebLocalFrame* thirdFrame(FrameTestHelpers::createLocalChild(
9632 parent, "name3", nullptr, nullptr, secondFrame)); 9635 parent, "name3", nullptr, nullptr, secondFrame));
9633 WebLocalFrame* firstFrame( 9636 WebLocalFrame* firstFrame(
9634 FrameTestHelpers::createLocalChild(parent, "name1")); 9637 FrameTestHelpers::createLocalChild(parent, "name1"));
(...skipping 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after
11395 11398
11396 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); 11399 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached());
11397 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); 11400 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading());
11398 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); 11401 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad());
11399 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); 11402 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents());
11400 11403
11401 webViewHelper.reset(); 11404 webViewHelper.reset();
11402 } 11405 }
11403 11406
11404 } // namespace blink 11407 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp ('k') | url/origin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698