| OLD | NEW | 
|---|
| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" | 
| 6 | 6 | 
| 7 #include "base/memory/shared_memory.h" | 7 #include "base/memory/shared_memory.h" | 
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" | 
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" | 
| 10 #include "content/common/ssl_status_serialization.h" | 10 #include "content/common/ssl_status_serialization.h" | 
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 103   virtual bool UseWebUIForURL(BrowserContext* browser_context, | 103   virtual bool UseWebUIForURL(BrowserContext* browser_context, | 
| 104                               const GURL& url) const OVERRIDE { | 104                               const GURL& url) const OVERRIDE { | 
| 105     return HasWebUIScheme(url); | 105     return HasWebUIScheme(url); | 
| 106   } | 106   } | 
| 107   virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context, | 107   virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context, | 
| 108                                       const GURL& url) const OVERRIDE { | 108                                       const GURL& url) const OVERRIDE { | 
| 109     return HasWebUIScheme(url); | 109     return HasWebUIScheme(url); | 
| 110   } | 110   } | 
| 111 }; | 111 }; | 
| 112 | 112 | 
| 113 class MockRenderViewPepperHelper : public RenderViewPepperHelper { | 113 class MockPepperHelper : public PepperHelper { | 
| 114  public: | 114  public: | 
| 115   MockRenderViewPepperHelper() : text_input_type_(ui::TEXT_INPUT_TYPE_NONE) {} | 115   MockPepperHelper() : text_input_type_(ui::TEXT_INPUT_TYPE_NONE) {} | 
| 116   virtual bool IsPluginFocused() const OVERRIDE { | 116   virtual bool IsPluginFocused() const OVERRIDE { | 
| 117     return true; | 117     return true; | 
| 118   } | 118   } | 
| 119   virtual ui::TextInputType GetTextInputType() const OVERRIDE { | 119   virtual ui::TextInputType GetTextInputType() const OVERRIDE { | 
| 120     return text_input_type_; | 120     return text_input_type_; | 
| 121   } | 121   } | 
| 122   void SetTextInputType(ui::TextInputType text_input_type) { | 122   void SetTextInputType(ui::TextInputType text_input_type) { | 
| 123     text_input_type_ = text_input_type; | 123     text_input_type_ = text_input_type; | 
| 124   } | 124   } | 
| 125  private: | 125  private: | 
| (...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1933   EXPECT_EQ(output, L"hello \n\nworld"); | 1933   EXPECT_EQ(output, L"hello \n\nworld"); | 
| 1934 } | 1934 } | 
| 1935 | 1935 | 
| 1936 // This test ensures that a RenderFrame object is created for the top level | 1936 // This test ensures that a RenderFrame object is created for the top level | 
| 1937 // frame in the RenderView. | 1937 // frame in the RenderView. | 
| 1938 TEST_F(RenderViewImplTest, BasicRenderFrame) { | 1938 TEST_F(RenderViewImplTest, BasicRenderFrame) { | 
| 1939   EXPECT_TRUE(view()->main_render_frame_.get()); | 1939   EXPECT_TRUE(view()->main_render_frame_.get()); | 
| 1940 } | 1940 } | 
| 1941 | 1941 | 
| 1942 TEST_F(RenderViewImplTest, TextInputTypeWithPepper) { | 1942 TEST_F(RenderViewImplTest, TextInputTypeWithPepper) { | 
| 1943   MockRenderViewPepperHelper* pepper_helper = new MockRenderViewPepperHelper(); | 1943   MockPepperHelper* pepper_helper = new MockPepperHelper(); | 
| 1944   pepper_helper->SetTextInputType(ui::TEXT_INPUT_TYPE_EMAIL); | 1944   pepper_helper->SetTextInputType(ui::TEXT_INPUT_TYPE_EMAIL); | 
| 1945   view()->pepper_helper_ .reset(pepper_helper); | 1945   view()->pepper_helper_ .reset(pepper_helper); | 
| 1946 | 1946 | 
| 1947   view()->OnSetInputMethodActive(true); | 1947   view()->OnSetInputMethodActive(true); | 
| 1948   view()->set_send_content_state_immediately(true); | 1948   view()->set_send_content_state_immediately(true); | 
| 1949   LoadHTML("<html>" | 1949   LoadHTML("<html>" | 
| 1950            "<head>" | 1950            "<head>" | 
| 1951            "</head>" | 1951            "</head>" | 
| 1952            "<body>" | 1952            "<body>" | 
| 1953            "<input id=\"test1\" type=\"text\" value=\"some text\"></input>" | 1953            "<input id=\"test1\" type=\"text\" value=\"some text\"></input>" | 
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1985   EXPECT_FALSE(net::IsCertStatusError(ssl_status.cert_status)); | 1985   EXPECT_FALSE(net::IsCertStatusError(ssl_status.cert_status)); | 
| 1986 | 1986 | 
| 1987   const_cast<WebKit::WebURLResponse&>(frame->dataSource()->response()). | 1987   const_cast<WebKit::WebURLResponse&>(frame->dataSource()->response()). | 
| 1988       setSecurityInfo( | 1988       setSecurityInfo( | 
| 1989           SerializeSecurityInfo(0, net::CERT_STATUS_ALL_ERRORS, 0, 0)); | 1989           SerializeSecurityInfo(0, net::CERT_STATUS_ALL_ERRORS, 0, 0)); | 
| 1990   ssl_status = view()->GetSSLStatusOfFrame(frame); | 1990   ssl_status = view()->GetSSLStatusOfFrame(frame); | 
| 1991   EXPECT_TRUE(net::IsCertStatusError(ssl_status.cert_status)); | 1991   EXPECT_TRUE(net::IsCertStatusError(ssl_status.cert_status)); | 
| 1992 } | 1992 } | 
| 1993 | 1993 | 
| 1994 }  // namespace content | 1994 }  // namespace content | 
| OLD | NEW | 
|---|