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

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, 8 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 4741 matching lines...) Expand 10 before | Expand all | Expand 10 after
4752 { 4752 {
4753 registerMockedHttpURLLoad("fragment_middle_click.html"); 4753 registerMockedHttpURLLoad("fragment_middle_click.html");
4754 TestNavigationPolicyWebFrameClient client; 4754 TestNavigationPolicyWebFrameClient client;
4755 FrameTestHelpers::WebViewHelper webViewHelper; 4755 FrameTestHelpers::WebViewHelper webViewHelper;
4756 webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", tr ue, &client); 4756 webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", tr ue, &client);
4757 4757
4758 WebCore::Document* document = webViewHelper.webViewImpl()->page()->mainFrame ()->document(); 4758 WebCore::Document* document = webViewHelper.webViewImpl()->page()->mainFrame ()->document();
4759 WebCore::KURL destination = document->url(); 4759 WebCore::KURL destination = document->url();
4760 destination.setFragmentIdentifier("test"); 4760 destination.setFragmentIdentifier("test");
4761 4761
4762 RefPtr<WebCore::Event> event = WebCore::MouseEvent::create(WebCore::EventTyp eNames::click, false, false, 4762 RefPtrWillBeRawPtr<WebCore::Event> event = WebCore::MouseEvent::create(WebCo re::EventTypeNames::click, false, false,
4763 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, false, false, false, false, 1, nullptr, nullptr); 4763 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, false, false, false, false, 1, nullptr, nullptr);
4764 WebCore::FrameLoadRequest frameRequest(document, WebCore::ResourceRequest(de stination)); 4764 WebCore::FrameLoadRequest frameRequest(document, WebCore::ResourceRequest(de stination));
4765 frameRequest.setTriggeringEvent(event); 4765 frameRequest.setTriggeringEvent(event);
4766 webViewHelper.webViewImpl()->page()->mainFrame()->loader().load(frameRequest ); 4766 webViewHelper.webViewImpl()->page()->mainFrame()->loader().load(frameRequest );
4767 } 4767 }
4768 4768
4769 class TestNewWindowWebViewClient : public WebViewClient { 4769 class TestNewWindowWebViewClient : public WebViewClient {
4770 public: 4770 public:
4771 virtual WebView* createView(WebLocalFrame*, const WebURLRequest&, const WebW indowFeatures&, 4771 virtual WebView* createView(WebLocalFrame*, const WebURLRequest&, const WebW indowFeatures&,
4772 const WebString&, WebNavigationPolicy, bool) OVERRIDE 4772 const WebString&, WebNavigationPolicy, bool) OVERRIDE
(...skipping 29 matching lines...) Expand all
4802 registerMockedHttpURLLoad("hello_world.html"); 4802 registerMockedHttpURLLoad("hello_world.html");
4803 TestNewWindowWebViewClient webViewClient; 4803 TestNewWindowWebViewClient webViewClient;
4804 TestNewWindowWebFrameClient webFrameClient; 4804 TestNewWindowWebFrameClient webFrameClient;
4805 FrameTestHelpers::WebViewHelper webViewHelper; 4805 FrameTestHelpers::WebViewHelper webViewHelper;
4806 webViewHelper.initializeAndLoad(m_baseURL + "ctrl_click.html", true, &webFra meClient, &webViewClient); 4806 webViewHelper.initializeAndLoad(m_baseURL + "ctrl_click.html", true, &webFra meClient, &webViewClient);
4807 4807
4808 WebCore::Document* document = webViewHelper.webViewImpl()->page()->mainFrame ()->document(); 4808 WebCore::Document* document = webViewHelper.webViewImpl()->page()->mainFrame ()->document();
4809 WebCore::KURL destination = toKURL(m_baseURL + "hello_world.html"); 4809 WebCore::KURL destination = toKURL(m_baseURL + "hello_world.html");
4810 4810
4811 // ctrl+click event 4811 // ctrl+click event
4812 RefPtr<WebCore::Event> event = WebCore::MouseEvent::create(WebCore::EventTyp eNames::click, false, false, 4812 RefPtrWillBeRawPtr<WebCore::Event> event = WebCore::MouseEvent::create(WebCo re::EventTypeNames::click, false, false,
4813 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, true, false, false, false, 0 , nullptr, nullptr); 4813 document->domWindow(), 0, 0, 0, 0, 0, 0, 0, true, false, false, false, 0 , nullptr, nullptr);
4814 WebCore::FrameLoadRequest frameRequest(document, WebCore::ResourceRequest(de stination)); 4814 WebCore::FrameLoadRequest frameRequest(document, WebCore::ResourceRequest(de stination));
4815 frameRequest.setTriggeringEvent(event); 4815 frameRequest.setTriggeringEvent(event);
4816 WebCore::UserGestureIndicator gesture(WebCore::DefinitelyProcessingUserGestu re); 4816 WebCore::UserGestureIndicator gesture(WebCore::DefinitelyProcessingUserGestu re);
4817 webViewHelper.webViewImpl()->page()->mainFrame()->loader().load(frameRequest ); 4817 webViewHelper.webViewImpl()->page()->mainFrame()->loader().load(frameRequest );
4818 4818
4819 // decidePolicyForNavigation should be called both for the original request and the ctrl+click. 4819 // decidePolicyForNavigation should be called both for the original request and the ctrl+click.
4820 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount()); 4820 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount());
4821 } 4821 }
4822 4822
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
5482 EXPECT_EQ(2U, container->percentHeightDescendants()->size()); 5482 EXPECT_EQ(2U, container->percentHeightDescendants()->size());
5483 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA nonymous)); 5483 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA nonymous));
5484 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir ectChild)); 5484 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir ectChild));
5485 5485
5486 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB lock(); 5486 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB lock();
5487 EXPECT_TRUE(anonymousBlock->isAnonymous()); 5487 EXPECT_TRUE(anonymousBlock->isAnonymous());
5488 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants()); 5488 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants());
5489 } 5489 }
5490 5490
5491 } // namespace 5491 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698