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

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

Issue 216523002: Oilpan: Replace most of RefPtrs for Event objects with oilpan's transition types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
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 4721 matching lines...) Expand 10 before | Expand all | Expand 10 after
4732 { 4732 {
4733 registerMockedHttpURLLoad("fragment_middle_click.html"); 4733 registerMockedHttpURLLoad("fragment_middle_click.html");
4734 TestNavigationPolicyWebFrameClient client; 4734 TestNavigationPolicyWebFrameClient client;
4735 FrameTestHelpers::WebViewHelper webViewHelper; 4735 FrameTestHelpers::WebViewHelper webViewHelper;
4736 webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", tr ue, &client); 4736 webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", tr ue, &client);
4737 4737
4738 WebCore::Document* document = webViewHelper.webViewImpl()->page()->mainFrame ()->document(); 4738 WebCore::Document* document = webViewHelper.webViewImpl()->page()->mainFrame ()->document();
4739 WebCore::KURL destination = document->url(); 4739 WebCore::KURL destination = document->url();
4740 destination.setFragmentIdentifier("test"); 4740 destination.setFragmentIdentifier("test");
4741 4741
4742 RefPtr<WebCore::Event> event = WebCore::MouseEvent::create(WebCore::EventTyp eNames::click, false, false, 4742 RefPtrWillBeRawPtr<WebCore::Event> event = WebCore::MouseEvent::create(WebCo re::EventTypeNames::click, false, false,
4743 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, false, false, false, false, 1, nullptr, nullptr); 4743 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, false, false, false, false, 1, nullptr, nullptr);
4744 WebCore::FrameLoadRequest frameRequest(document, WebCore::ResourceRequest(de stination)); 4744 WebCore::FrameLoadRequest frameRequest(document, WebCore::ResourceRequest(de stination));
4745 frameRequest.setTriggeringEvent(event); 4745 frameRequest.setTriggeringEvent(event);
4746 webViewHelper.webViewImpl()->page()->mainFrame()->loader().load(frameRequest ); 4746 webViewHelper.webViewImpl()->page()->mainFrame()->loader().load(frameRequest );
4747 } 4747 }
4748 4748
4749 class TestNewWindowWebViewClient : public WebViewClient { 4749 class TestNewWindowWebViewClient : public WebViewClient {
4750 public: 4750 public:
4751 virtual WebView* createView(WebFrame*, const WebURLRequest&, const WebWindow Features&, 4751 virtual WebView* createView(WebFrame*, const WebURLRequest&, const WebWindow Features&,
4752 const WebString&, WebNavigationPolicy, bool) OVERRIDE 4752 const WebString&, WebNavigationPolicy, bool) OVERRIDE
(...skipping 29 matching lines...) Expand all
4782 registerMockedHttpURLLoad("hello_world.html"); 4782 registerMockedHttpURLLoad("hello_world.html");
4783 TestNewWindowWebViewClient webViewClient; 4783 TestNewWindowWebViewClient webViewClient;
4784 TestNewWindowWebFrameClient webFrameClient; 4784 TestNewWindowWebFrameClient webFrameClient;
4785 FrameTestHelpers::WebViewHelper webViewHelper; 4785 FrameTestHelpers::WebViewHelper webViewHelper;
4786 webViewHelper.initializeAndLoad(m_baseURL + "ctrl_click.html", true, &webFra meClient, &webViewClient); 4786 webViewHelper.initializeAndLoad(m_baseURL + "ctrl_click.html", true, &webFra meClient, &webViewClient);
4787 4787
4788 WebCore::Document* document = webViewHelper.webViewImpl()->page()->mainFrame ()->document(); 4788 WebCore::Document* document = webViewHelper.webViewImpl()->page()->mainFrame ()->document();
4789 WebCore::KURL destination = toKURL(m_baseURL + "hello_world.html"); 4789 WebCore::KURL destination = toKURL(m_baseURL + "hello_world.html");
4790 4790
4791 // ctrl+click event 4791 // ctrl+click event
4792 RefPtr<WebCore::Event> event = WebCore::MouseEvent::create(WebCore::EventTyp eNames::click, false, false, 4792 RefPtrWillBeRawPtr<WebCore::Event> event = WebCore::MouseEvent::create(WebCo re::EventTypeNames::click, false, false,
4793 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, true, false, false, false, 0 , nullptr, nullptr); 4793 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, true, false, false, false, 0 , nullptr, nullptr);
4794 WebCore::FrameLoadRequest frameRequest(document, WebCore::ResourceRequest(de stination)); 4794 WebCore::FrameLoadRequest frameRequest(document, WebCore::ResourceRequest(de stination));
4795 frameRequest.setTriggeringEvent(event); 4795 frameRequest.setTriggeringEvent(event);
4796 WebCore::UserGestureIndicator gesture(WebCore::DefinitelyProcessingUserGestu re); 4796 WebCore::UserGestureIndicator gesture(WebCore::DefinitelyProcessingUserGestu re);
4797 webViewHelper.webViewImpl()->page()->mainFrame()->loader().load(frameRequest ); 4797 webViewHelper.webViewImpl()->page()->mainFrame()->loader().load(frameRequest );
4798 4798
4799 // decidePolicyForNavigation should be called both for the original request and the ctrl+click. 4799 // decidePolicyForNavigation should be called both for the original request and the ctrl+click.
4800 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount()); 4800 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount());
4801 } 4801 }
4802 4802
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
5390 EXPECT_EQ(2U, container->percentHeightDescendants()->size()); 5390 EXPECT_EQ(2U, container->percentHeightDescendants()->size());
5391 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA nonymous)); 5391 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA nonymous));
5392 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir ectChild)); 5392 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir ectChild));
5393 5393
5394 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB lock(); 5394 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB lock();
5395 EXPECT_TRUE(anonymousBlock->isAnonymous()); 5395 EXPECT_TRUE(anonymousBlock->isAnonymous());
5396 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants()); 5396 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants());
5397 } 5397 }
5398 5398
5399 } // namespace 5399 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698