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 5796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5807 registerMockedHttpURLLoad("fragment_middle_click.html"); | 5807 registerMockedHttpURLLoad("fragment_middle_click.html"); |
5808 TestNavigationPolicyWebFrameClient client; | 5808 TestNavigationPolicyWebFrameClient client; |
5809 FrameTestHelpers::WebViewHelper webViewHelper(this); | 5809 FrameTestHelpers::WebViewHelper webViewHelper(this); |
5810 webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", tr
ue, &client); | 5810 webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", tr
ue, &client); |
5811 | 5811 |
5812 Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainF
rame())->document(); | 5812 Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainF
rame())->document(); |
5813 KURL destination = document->url(); | 5813 KURL destination = document->url(); |
5814 destination.setFragmentIdentifier("test"); | 5814 destination.setFragmentIdentifier("test"); |
5815 | 5815 |
5816 RefPtrWillBeRawPtr<Event> event = MouseEvent::create(EventTypeNames::click,
false, false, | 5816 RefPtrWillBeRawPtr<Event> event = MouseEvent::create(EventTypeNames::click,
false, false, |
5817 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, PlatformEvent::NoModifiers,
1, 0, nullptr, 0); | 5817 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, PlatformEvent::NoModifiers,
1, 0, nullptr, 0, |
| 5818 PlatformMouseEvent::RealOrIndistinguishable, String()); |
5818 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); | 5819 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); |
5819 frameRequest.setTriggeringEvent(event); | 5820 frameRequest.setTriggeringEvent(event); |
5820 toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().loa
d(frameRequest); | 5821 toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().loa
d(frameRequest); |
5821 } | 5822 } |
5822 | 5823 |
5823 class TestNewWindowWebViewClient : public FrameTestHelpers::TestWebViewClient { | 5824 class TestNewWindowWebViewClient : public FrameTestHelpers::TestWebViewClient { |
5824 public: | 5825 public: |
5825 virtual WebView* createView(WebLocalFrame*, const WebURLRequest&, const WebW
indowFeatures&, | 5826 virtual WebView* createView(WebLocalFrame*, const WebURLRequest&, const WebW
indowFeatures&, |
5826 const WebString&, WebNavigationPolicy, bool) override | 5827 const WebString&, WebNavigationPolicy, bool) override |
5827 { | 5828 { |
(...skipping 28 matching lines...) Expand all Loading... |
5856 TestNewWindowWebViewClient webViewClient; | 5857 TestNewWindowWebViewClient webViewClient; |
5857 TestNewWindowWebFrameClient webFrameClient; | 5858 TestNewWindowWebFrameClient webFrameClient; |
5858 FrameTestHelpers::WebViewHelper webViewHelper(this); | 5859 FrameTestHelpers::WebViewHelper webViewHelper(this); |
5859 webViewHelper.initializeAndLoad(m_baseURL + "ctrl_click.html", true, &webFra
meClient, &webViewClient); | 5860 webViewHelper.initializeAndLoad(m_baseURL + "ctrl_click.html", true, &webFra
meClient, &webViewClient); |
5860 | 5861 |
5861 Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainF
rame())->document(); | 5862 Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainF
rame())->document(); |
5862 KURL destination = toKURL(m_baseURL + "hello_world.html"); | 5863 KURL destination = toKURL(m_baseURL + "hello_world.html"); |
5863 | 5864 |
5864 // ctrl+click event | 5865 // ctrl+click event |
5865 RefPtrWillBeRawPtr<Event> event = MouseEvent::create(EventTypeNames::click,
false, false, | 5866 RefPtrWillBeRawPtr<Event> event = MouseEvent::create(EventTypeNames::click,
false, false, |
5866 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, PlatformEvent::CtrlKey, 0, 0
, nullptr, 0); | 5867 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, PlatformEvent::CtrlKey, 0, 0
, nullptr, 0, |
| 5868 PlatformMouseEvent::RealOrIndistinguishable, String()); |
5867 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); | 5869 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); |
5868 frameRequest.setTriggeringEvent(event); | 5870 frameRequest.setTriggeringEvent(event); |
5869 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); | 5871 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); |
5870 toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().loa
d(frameRequest); | 5872 toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().loa
d(frameRequest); |
5871 FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webViewHelper.webView()-
>mainFrame()); | 5873 FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webViewHelper.webView()-
>mainFrame()); |
5872 | 5874 |
5873 // decidePolicyForNavigation should be called both for the original request
and the ctrl+click. | 5875 // decidePolicyForNavigation should be called both for the original request
and the ctrl+click. |
5874 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount()); | 5876 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount()); |
5875 } | 5877 } |
5876 | 5878 |
(...skipping 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8505 } | 8507 } |
8506 | 8508 |
8507 TEST_F(WebFrameVisibilityChangeTest, RemoteFrameParentVisibilityChange) | 8509 TEST_F(WebFrameVisibilityChangeTest, RemoteFrameParentVisibilityChange) |
8508 { | 8510 { |
8509 swapLocalFrameToRemoteFrame(); | 8511 swapLocalFrameToRemoteFrame(); |
8510 executeScriptOnMainFrame(WebScriptSource("document.querySelector('iframe').p
arentElement.style.display = 'none';")); | 8512 executeScriptOnMainFrame(WebScriptSource("document.querySelector('iframe').p
arentElement.style.display = 'none';")); |
8511 EXPECT_FALSE(remoteFrameClient()->isVisible()); | 8513 EXPECT_FALSE(remoteFrameClient()->isVisible()); |
8512 } | 8514 } |
8513 | 8515 |
8514 } // namespace blink | 8516 } // namespace blink |
OLD | NEW |