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

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

Issue 179013002: Add WebDocument::clearFocusedElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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/WebViewImpl.cpp ('k') | public/web/WebView.h » ('j') | 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 2700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2711 2711
2712 TEST_F(WebFrameTest, ClearFocusedNodeTest) 2712 TEST_F(WebFrameTest, ClearFocusedNodeTest)
2713 { 2713 {
2714 registerMockedHttpURLLoad("iframe_clear_focused_node_test.html"); 2714 registerMockedHttpURLLoad("iframe_clear_focused_node_test.html");
2715 registerMockedHttpURLLoad("autofocus_input_field_iframe.html"); 2715 registerMockedHttpURLLoad("autofocus_input_field_iframe.html");
2716 2716
2717 FrameTestHelpers::WebViewHelper webViewHelper; 2717 FrameTestHelpers::WebViewHelper webViewHelper;
2718 webViewHelper.initializeAndLoad(m_baseURL + "iframe_clear_focused_node_test. html", true); 2718 webViewHelper.initializeAndLoad(m_baseURL + "iframe_clear_focused_node_test. html", true);
2719 2719
2720 // Clear the focused node. 2720 // Clear the focused node.
2721 webViewHelper.webView()->clearFocusedNode(); 2721 webViewHelper.webView()->clearFocusedElement();
2722 2722
2723 // Now retrieve the FocusedNode and test it should be null. 2723 // Now retrieve the FocusedNode and test it should be null.
2724 EXPECT_EQ(0, webViewHelper.webViewImpl()->focusedElement()); 2724 EXPECT_EQ(0, webViewHelper.webViewImpl()->focusedElement());
2725 } 2725 }
2726 2726
2727 // Implementation of WebFrameClient that tracks the v8 contexts that are created 2727 // Implementation of WebFrameClient that tracks the v8 contexts that are created
2728 // and destroyed for verification. 2728 // and destroyed for verification.
2729 class ContextLifetimeTestWebFrameClient : public FrameTestHelpers::TestWebFrameC lient { 2729 class ContextLifetimeTestWebFrameClient : public FrameTestHelpers::TestWebFrameC lient {
2730 public: 2730 public:
2731 struct Notification { 2731 struct Notification {
(...skipping 2430 matching lines...) Expand 10 before | Expand all | Expand 10 after
5162 webViewHelper.initializeAndLoad("about:blank"); 5162 webViewHelper.initializeAndLoad("about:blank");
5163 5163
5164 WebCore::FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl() ->frameView(); 5164 WebCore::FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl() ->frameView();
5165 frameView->setFrameRect(WebCore::IntRect(0, 0, 200, 200)); 5165 frameView->setFrameRect(WebCore::IntRect(0, 0, 200, 200));
5166 EXPECT_EQ_RECT(WebCore::IntRect(0, 0, 200, 200), frameView->frameRect()); 5166 EXPECT_EQ_RECT(WebCore::IntRect(0, 0, 200, 200), frameView->frameRect());
5167 frameView->setFrameRect(WebCore::IntRect(100, 100, 200, 200)); 5167 frameView->setFrameRect(WebCore::IntRect(100, 100, 200, 200));
5168 EXPECT_EQ_RECT(WebCore::IntRect(100, 100, 200, 200), frameView->frameRect()) ; 5168 EXPECT_EQ_RECT(WebCore::IntRect(100, 100, 200, 200), frameView->frameRect()) ;
5169 } 5169 }
5170 5170
5171 } // namespace 5171 } // namespace
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | public/web/WebView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698