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 5788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5799 registerMockedHttpURLLoad("fragment_middle_click.html"); | 5799 registerMockedHttpURLLoad("fragment_middle_click.html"); |
5800 TestNavigationPolicyWebFrameClient client; | 5800 TestNavigationPolicyWebFrameClient client; |
5801 FrameTestHelpers::WebViewHelper webViewHelper(this); | 5801 FrameTestHelpers::WebViewHelper webViewHelper(this); |
5802 webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", tr
ue, &client); | 5802 webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", tr
ue, &client); |
5803 | 5803 |
5804 Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainF
rame())->document(); | 5804 Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainF
rame())->document(); |
5805 KURL destination = document->url(); | 5805 KURL destination = document->url(); |
5806 destination.setFragmentIdentifier("test"); | 5806 destination.setFragmentIdentifier("test"); |
5807 | 5807 |
5808 RefPtrWillBeRawPtr<Event> event = MouseEvent::create(EventTypeNames::click,
false, false, | 5808 RefPtrWillBeRawPtr<Event> event = MouseEvent::create(EventTypeNames::click,
false, false, |
5809 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, PlatformEvent::NoModifiers,
1, 0, nullptr, 0); | 5809 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, PlatformEvent::NoModifiers,
1, 0, nullptr, 0, |
| 5810 PlatformMouseEvent::RealOrIndistinguishable, String()); |
5810 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); | 5811 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); |
5811 frameRequest.setTriggeringEvent(event); | 5812 frameRequest.setTriggeringEvent(event); |
5812 toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().loa
d(frameRequest); | 5813 toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().loa
d(frameRequest); |
5813 } | 5814 } |
5814 | 5815 |
5815 class TestNewWindowWebViewClient : public FrameTestHelpers::TestWebViewClient { | 5816 class TestNewWindowWebViewClient : public FrameTestHelpers::TestWebViewClient { |
5816 public: | 5817 public: |
5817 virtual WebView* createView(WebLocalFrame*, const WebURLRequest&, const WebW
indowFeatures&, | 5818 virtual WebView* createView(WebLocalFrame*, const WebURLRequest&, const WebW
indowFeatures&, |
5818 const WebString&, WebNavigationPolicy, bool) override | 5819 const WebString&, WebNavigationPolicy, bool) override |
5819 { | 5820 { |
(...skipping 28 matching lines...) Expand all Loading... |
5848 TestNewWindowWebViewClient webViewClient; | 5849 TestNewWindowWebViewClient webViewClient; |
5849 TestNewWindowWebFrameClient webFrameClient; | 5850 TestNewWindowWebFrameClient webFrameClient; |
5850 FrameTestHelpers::WebViewHelper webViewHelper(this); | 5851 FrameTestHelpers::WebViewHelper webViewHelper(this); |
5851 webViewHelper.initializeAndLoad(m_baseURL + "ctrl_click.html", true, &webFra
meClient, &webViewClient); | 5852 webViewHelper.initializeAndLoad(m_baseURL + "ctrl_click.html", true, &webFra
meClient, &webViewClient); |
5852 | 5853 |
5853 Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainF
rame())->document(); | 5854 Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainF
rame())->document(); |
5854 KURL destination = toKURL(m_baseURL + "hello_world.html"); | 5855 KURL destination = toKURL(m_baseURL + "hello_world.html"); |
5855 | 5856 |
5856 // ctrl+click event | 5857 // ctrl+click event |
5857 RefPtrWillBeRawPtr<Event> event = MouseEvent::create(EventTypeNames::click,
false, false, | 5858 RefPtrWillBeRawPtr<Event> event = MouseEvent::create(EventTypeNames::click,
false, false, |
5858 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, PlatformEvent::CtrlKey, 0, 0
, nullptr, 0); | 5859 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, PlatformEvent::CtrlKey, 0, 0
, nullptr, 0, |
| 5860 PlatformMouseEvent::RealOrIndistinguishable, String()); |
5859 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); | 5861 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); |
5860 frameRequest.setTriggeringEvent(event); | 5862 frameRequest.setTriggeringEvent(event); |
5861 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); | 5863 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); |
5862 toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().loa
d(frameRequest); | 5864 toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().loa
d(frameRequest); |
5863 FrameTestHelpers::pumpPendingRequestsDoNotUse(webViewHelper.webView()->mainF
rame()); | 5865 FrameTestHelpers::pumpPendingRequestsDoNotUse(webViewHelper.webView()->mainF
rame()); |
5864 | 5866 |
5865 // decidePolicyForNavigation should be called both for the original request
and the ctrl+click. | 5867 // decidePolicyForNavigation should be called both for the original request
and the ctrl+click. |
5866 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount()); | 5868 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount()); |
5867 } | 5869 } |
5868 | 5870 |
(...skipping 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8497 } | 8499 } |
8498 | 8500 |
8499 TEST_F(WebFrameVisibilityChangeTest, RemoteFrameParentVisibilityChange) | 8501 TEST_F(WebFrameVisibilityChangeTest, RemoteFrameParentVisibilityChange) |
8500 { | 8502 { |
8501 swapLocalFrameToRemoteFrame(); | 8503 swapLocalFrameToRemoteFrame(); |
8502 executeScriptOnMainFrame(WebScriptSource("document.querySelector('iframe').p
arentElement.style.display = 'none';")); | 8504 executeScriptOnMainFrame(WebScriptSource("document.querySelector('iframe').p
arentElement.style.display = 'none';")); |
8503 EXPECT_FALSE(remoteFrameClient()->isVisible()); | 8505 EXPECT_FALSE(remoteFrameClient()->isVisible()); |
8504 } | 8506 } |
8505 | 8507 |
8506 } // namespace blink | 8508 } // namespace blink |
OLD | NEW |