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

Side by Side Diff: content/renderer/render_view_browsertest.cc

Issue 2623483003: Support tracking focused node element for OOPIFs. (Closed)
Patch Set: Added the missing forward declaration Created 3 years, 11 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 | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_view_impl.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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <tuple> 7 #include <tuple>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( 1891 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching(
1892 ViewHostMsg_UpdateFaviconURL::ID)); 1892 ViewHostMsg_UpdateFaviconURL::ID));
1893 } 1893 }
1894 1894
1895 TEST_F(RenderViewImplTest, FocusElementCallsFocusedNodeChanged) { 1895 TEST_F(RenderViewImplTest, FocusElementCallsFocusedNodeChanged) {
1896 LoadHTML("<input id='test1' value='hello1'></input>" 1896 LoadHTML("<input id='test1' value='hello1'></input>"
1897 "<input id='test2' value='hello2'></input>"); 1897 "<input id='test2' value='hello2'></input>");
1898 1898
1899 ExecuteJavaScriptForTests("document.getElementById('test1').focus();"); 1899 ExecuteJavaScriptForTests("document.getElementById('test1').focus();");
1900 const IPC::Message* msg1 = render_thread_->sink().GetFirstMessageMatching( 1900 const IPC::Message* msg1 = render_thread_->sink().GetFirstMessageMatching(
1901 ViewHostMsg_FocusedNodeChanged::ID); 1901 FrameHostMsg_FocusedNodeChanged::ID);
1902 EXPECT_TRUE(msg1); 1902 EXPECT_TRUE(msg1);
1903 1903
1904 ViewHostMsg_FocusedNodeChanged::Param params; 1904 FrameHostMsg_FocusedNodeChanged::Param params;
1905 ViewHostMsg_FocusedNodeChanged::Read(msg1, &params); 1905 FrameHostMsg_FocusedNodeChanged::Read(msg1, &params);
1906 EXPECT_TRUE(std::get<0>(params)); 1906 EXPECT_TRUE(std::get<0>(params));
1907 render_thread_->sink().ClearMessages(); 1907 render_thread_->sink().ClearMessages();
1908 1908
1909 ExecuteJavaScriptForTests("document.getElementById('test2').focus();"); 1909 ExecuteJavaScriptForTests("document.getElementById('test2').focus();");
1910 const IPC::Message* msg2 = render_thread_->sink().GetFirstMessageMatching( 1910 const IPC::Message* msg2 = render_thread_->sink().GetFirstMessageMatching(
1911 ViewHostMsg_FocusedNodeChanged::ID); 1911 FrameHostMsg_FocusedNodeChanged::ID);
1912 EXPECT_TRUE(msg2); 1912 EXPECT_TRUE(msg2);
1913 ViewHostMsg_FocusedNodeChanged::Read(msg2, &params); 1913 FrameHostMsg_FocusedNodeChanged::Read(msg2, &params);
1914 EXPECT_TRUE(std::get<0>(params)); 1914 EXPECT_TRUE(std::get<0>(params));
1915 render_thread_->sink().ClearMessages(); 1915 render_thread_->sink().ClearMessages();
1916 1916
1917 view()->webview()->clearFocusedElement(); 1917 view()->webview()->clearFocusedElement();
1918 const IPC::Message* msg3 = render_thread_->sink().GetFirstMessageMatching( 1918 const IPC::Message* msg3 = render_thread_->sink().GetFirstMessageMatching(
1919 ViewHostMsg_FocusedNodeChanged::ID); 1919 FrameHostMsg_FocusedNodeChanged::ID);
1920 EXPECT_TRUE(msg3); 1920 EXPECT_TRUE(msg3);
1921 ViewHostMsg_FocusedNodeChanged::Read(msg3, &params); 1921 FrameHostMsg_FocusedNodeChanged::Read(msg3, &params);
1922 EXPECT_FALSE(std::get<0>(params)); 1922 EXPECT_FALSE(std::get<0>(params));
1923 render_thread_->sink().ClearMessages(); 1923 render_thread_->sink().ClearMessages();
1924 } 1924 }
1925 1925
1926 TEST_F(RenderViewImplTest, ServiceWorkerNetworkProviderSetup) { 1926 TEST_F(RenderViewImplTest, ServiceWorkerNetworkProviderSetup) {
1927 ServiceWorkerNetworkProvider* provider = NULL; 1927 ServiceWorkerNetworkProvider* provider = NULL;
1928 RequestExtraData* extra_data = NULL; 1928 RequestExtraData* extra_data = NULL;
1929 1929
1930 // Make sure each new document has a new provider and 1930 // Make sure each new document has a new provider and
1931 // that the main request is tagged with the provider's id. 1931 // that the main request is tagged with the provider's id.
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
2550 ExpectPauseAndResume(3); 2550 ExpectPauseAndResume(3);
2551 blink::WebScriptSource source2( 2551 blink::WebScriptSource source2(
2552 WebString::fromUTF8("function func2() { func1(); }; func2();")); 2552 WebString::fromUTF8("function func2() { func1(); }; func2();"));
2553 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1); 2553 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1);
2554 2554
2555 EXPECT_FALSE(IsPaused()); 2555 EXPECT_FALSE(IsPaused());
2556 Detach(); 2556 Detach();
2557 } 2557 }
2558 2558
2559 } // namespace content 2559 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698