OLD | NEW |
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 7959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7970 | 7970 |
7971 TEST_P(DeviceEmulationTest, PointerAndHoverTypes) | 7971 TEST_P(DeviceEmulationTest, PointerAndHoverTypes) |
7972 { | 7972 { |
7973 WebDeviceEmulationParams params; | 7973 WebDeviceEmulationParams params; |
7974 params.screenPosition = WebDeviceEmulationParams::Mobile; | 7974 params.screenPosition = WebDeviceEmulationParams::Mobile; |
7975 m_webViewHelper.webView()->enableDeviceEmulation(params); | 7975 m_webViewHelper.webView()->enableDeviceEmulation(params); |
7976 EXPECT_EQ("20x20", dumpSize("pointer")); | 7976 EXPECT_EQ("20x20", dumpSize("pointer")); |
7977 m_webViewHelper.webView()->disableDeviceEmulation(); | 7977 m_webViewHelper.webView()->disableDeviceEmulation(); |
7978 } | 7978 } |
7979 | 7979 |
7980 class WebLocalFrameScope final { | |
7981 WTF_MAKE_NONCOPYABLE(WebLocalFrameScope); | |
7982 public: | |
7983 explicit WebLocalFrameScope(WebLocalFrame* localFrame) | |
7984 : m_localFrame(localFrame) | |
7985 { | |
7986 } | |
7987 | |
7988 operator WebLocalFrame*() const | |
7989 { | |
7990 return m_localFrame; | |
7991 } | |
7992 | |
7993 WebLocalFrame* operator->() const | |
7994 { | |
7995 return m_localFrame; | |
7996 } | |
7997 | |
7998 ~WebLocalFrameScope() | |
7999 { | |
8000 m_localFrame->close(); | |
8001 } | |
8002 private: | |
8003 WebLocalFrame* m_localFrame; | |
8004 }; | |
8005 | |
8006 | |
8007 TEST_P(ParameterizedWebFrameTest, CreateLocalChildWithPreviousSibling) | 7980 TEST_P(ParameterizedWebFrameTest, CreateLocalChildWithPreviousSibling) |
8008 { | 7981 { |
8009 FrameTestHelpers::TestWebViewClient viewClient; | 7982 FrameTestHelpers::TestWebViewClient viewClient; |
8010 FrameTestHelpers::TestWebRemoteFrameClient remoteClient; | 7983 FrameTestHelpers::TestWebRemoteFrameClient remoteClient; |
8011 WebView* view = WebView::create(&viewClient); | 7984 WebView* view = WebView::create(&viewClient); |
8012 view->setMainFrame(remoteClient.frame()); | 7985 view->setMainFrame(remoteClient.frame()); |
8013 WebRemoteFrame* parent = view->mainFrame()->toWebRemoteFrame(); | 7986 WebRemoteFrame* parent = view->mainFrame()->toWebRemoteFrame(); |
8014 | 7987 |
8015 WebLocalFrameScope secondFrame(FrameTestHelpers::createLocalChild(parent, "n
ame2")); | 7988 WebLocalFrame* secondFrame(FrameTestHelpers::createLocalChild(parent, "name2
")); |
8016 WebLocalFrameScope fourthFrame(FrameTestHelpers::createLocalChild(parent, "n
ame4", nullptr, secondFrame)); | 7989 WebLocalFrame* fourthFrame(FrameTestHelpers::createLocalChild(parent, "name4
", nullptr, secondFrame)); |
8017 WebLocalFrameScope thirdFrame(FrameTestHelpers::createLocalChild(parent, "na
me3", nullptr, secondFrame)); | 7990 WebLocalFrame* thirdFrame(FrameTestHelpers::createLocalChild(parent, "name3"
, nullptr, secondFrame)); |
8018 WebLocalFrameScope firstFrame(FrameTestHelpers::createLocalChild(parent, "na
me1")); | 7991 WebLocalFrame* firstFrame(FrameTestHelpers::createLocalChild(parent, "name1"
)); |
8019 | 7992 |
8020 EXPECT_EQ(firstFrame, parent->firstChild()); | 7993 EXPECT_EQ(firstFrame, parent->firstChild()); |
8021 EXPECT_EQ(nullptr, firstFrame->previousSibling()); | 7994 EXPECT_EQ(nullptr, firstFrame->previousSibling()); |
8022 EXPECT_EQ(secondFrame, firstFrame->nextSibling()); | 7995 EXPECT_EQ(secondFrame, firstFrame->nextSibling()); |
8023 | 7996 |
8024 EXPECT_EQ(firstFrame, secondFrame->previousSibling()); | 7997 EXPECT_EQ(firstFrame, secondFrame->previousSibling()); |
8025 EXPECT_EQ(thirdFrame, secondFrame->nextSibling()); | 7998 EXPECT_EQ(thirdFrame, secondFrame->nextSibling()); |
8026 | 7999 |
8027 EXPECT_EQ(secondFrame, thirdFrame->previousSibling()); | 8000 EXPECT_EQ(secondFrame, thirdFrame->previousSibling()); |
8028 EXPECT_EQ(fourthFrame, thirdFrame->nextSibling()); | 8001 EXPECT_EQ(fourthFrame, thirdFrame->nextSibling()); |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8528 } | 8501 } |
8529 | 8502 |
8530 TEST_F(WebFrameVisibilityChangeTest, RemoteFrameParentVisibilityChange) | 8503 TEST_F(WebFrameVisibilityChangeTest, RemoteFrameParentVisibilityChange) |
8531 { | 8504 { |
8532 swapLocalFrameToRemoteFrame(); | 8505 swapLocalFrameToRemoteFrame(); |
8533 executeScriptOnMainFrame(WebScriptSource("document.querySelector('iframe').p
arentElement.style.display = 'none';")); | 8506 executeScriptOnMainFrame(WebScriptSource("document.querySelector('iframe').p
arentElement.style.display = 'none';")); |
8534 EXPECT_FALSE(remoteFrameClient()->isVisible()); | 8507 EXPECT_FALSE(remoteFrameClient()->isVisible()); |
8535 } | 8508 } |
8536 | 8509 |
8537 } // namespace blink | 8510 } // namespace blink |
OLD | NEW |