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

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

Issue 1232003009: Implement DragEvent and move MouseEvent.dataTransfer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix plugin failure of LayoutTest Created 5 years, 4 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 | « Source/web/WebPluginContainerImpl.cpp ('k') | no next file » | 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 5704 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
OLDNEW
« no previous file with comments | « Source/web/WebPluginContainerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698