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 5704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5715 registerMockedHttpURLLoad("fragment_middle_click.html"); | 5715 registerMockedHttpURLLoad("fragment_middle_click.html"); |
5716 TestNavigationPolicyWebFrameClient client; | 5716 TestNavigationPolicyWebFrameClient client; |
5717 FrameTestHelpers::WebViewHelper webViewHelper(this); | 5717 FrameTestHelpers::WebViewHelper webViewHelper(this); |
5718 webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", tr
ue, &client); | 5718 webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", tr
ue, &client); |
5719 | 5719 |
5720 Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainF
rame())->document(); | 5720 Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainF
rame())->document(); |
5721 KURL destination = document->url(); | 5721 KURL destination = document->url(); |
5722 destination.setFragmentIdentifier("test"); | 5722 destination.setFragmentIdentifier("test"); |
5723 | 5723 |
5724 RefPtrWillBeRawPtr<Event> event = MouseEvent::create(EventTypeNames::click,
false, false, | 5724 RefPtrWillBeRawPtr<Event> event = MouseEvent::create(EventTypeNames::click,
false, false, |
5725 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, false, false, false, false,
1, 0, nullptr, nullptr); | 5725 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, false, false, false, false,
1, 0, nullptr); |
5726 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); | 5726 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); |
5727 frameRequest.setTriggeringEvent(event); | 5727 frameRequest.setTriggeringEvent(event); |
5728 toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().loa
d(frameRequest); | 5728 toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().loa
d(frameRequest); |
5729 } | 5729 } |
5730 | 5730 |
5731 class TestNewWindowWebViewClient : public FrameTestHelpers::TestWebViewClient { | 5731 class TestNewWindowWebViewClient : public FrameTestHelpers::TestWebViewClient { |
5732 public: | 5732 public: |
5733 virtual WebView* createView(WebLocalFrame*, const WebURLRequest&, const WebW
indowFeatures&, | 5733 virtual WebView* createView(WebLocalFrame*, const WebURLRequest&, const WebW
indowFeatures&, |
5734 const WebString&, WebNavigationPolicy, bool) override | 5734 const WebString&, WebNavigationPolicy, bool) override |
5735 { | 5735 { |
(...skipping 28 matching lines...) Expand all Loading... |
5764 TestNewWindowWebViewClient webViewClient; | 5764 TestNewWindowWebViewClient webViewClient; |
5765 TestNewWindowWebFrameClient webFrameClient; | 5765 TestNewWindowWebFrameClient webFrameClient; |
5766 FrameTestHelpers::WebViewHelper webViewHelper(this); | 5766 FrameTestHelpers::WebViewHelper webViewHelper(this); |
5767 webViewHelper.initializeAndLoad(m_baseURL + "ctrl_click.html", true, &webFra
meClient, &webViewClient); | 5767 webViewHelper.initializeAndLoad(m_baseURL + "ctrl_click.html", true, &webFra
meClient, &webViewClient); |
5768 | 5768 |
5769 Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainF
rame())->document(); | 5769 Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainF
rame())->document(); |
5770 KURL destination = toKURL(m_baseURL + "hello_world.html"); | 5770 KURL destination = toKURL(m_baseURL + "hello_world.html"); |
5771 | 5771 |
5772 // ctrl+click event | 5772 // ctrl+click event |
5773 RefPtrWillBeRawPtr<Event> event = MouseEvent::create(EventTypeNames::click,
false, false, | 5773 RefPtrWillBeRawPtr<Event> event = MouseEvent::create(EventTypeNames::click,
false, false, |
5774 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, true, false, false, false, 0
, 0, nullptr, nullptr); | 5774 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, true, false, false, false, 0
, 0, nullptr); |
5775 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); | 5775 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); |
5776 frameRequest.setTriggeringEvent(event); | 5776 frameRequest.setTriggeringEvent(event); |
5777 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); | 5777 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); |
5778 toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().loa
d(frameRequest); | 5778 toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().loa
d(frameRequest); |
5779 FrameTestHelpers::pumpPendingRequestsDoNotUse(webViewHelper.webView()->mainF
rame()); | 5779 FrameTestHelpers::pumpPendingRequestsDoNotUse(webViewHelper.webView()->mainF
rame()); |
5780 | 5780 |
5781 // decidePolicyForNavigation should be called both for the original request
and the ctrl+click. | 5781 // decidePolicyForNavigation should be called both for the original request
and the ctrl+click. |
5782 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount()); | 5782 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount()); |
5783 } | 5783 } |
5784 | 5784 |
(...skipping 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7955 | 7955 |
7956 TEST_F(WebFrameTest, MaxFramesDetach) | 7956 TEST_F(WebFrameTest, MaxFramesDetach) |
7957 { | 7957 { |
7958 registerMockedHttpURLLoad("max-frames-detach.html"); | 7958 registerMockedHttpURLLoad("max-frames-detach.html"); |
7959 FrameTestHelpers::WebViewHelper webViewHelper; | 7959 FrameTestHelpers::WebViewHelper webViewHelper; |
7960 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); | 7960 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); |
7961 webViewImpl->mainFrameImpl()->collectGarbage(); | 7961 webViewImpl->mainFrameImpl()->collectGarbage(); |
7962 } | 7962 } |
7963 | 7963 |
7964 } // namespace blink | 7964 } // namespace blink |
OLD | NEW |