| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 protected: | 60 protected: |
| 61 void SetUp() override { | 61 void SetUp() override { |
| 62 ON_CALL(m_webFrameClient, userAgentOverride()) | 62 ON_CALL(m_webFrameClient, userAgentOverride()) |
| 63 .WillByDefault(Return(WebString())); | 63 .WillByDefault(Return(WebString())); |
| 64 | 64 |
| 65 FrameTestHelpers::TestWebViewClient webViewClient; | 65 FrameTestHelpers::TestWebViewClient webViewClient; |
| 66 m_webView = WebView::create(&webViewClient, WebPageVisibilityStateVisible); | 66 m_webView = WebView::create(&webViewClient, WebPageVisibilityStateVisible); |
| 67 // FIXME: http://crbug.com/363843. This needs to find a better way to | 67 // FIXME: http://crbug.com/363843. This needs to find a better way to |
| 68 // not create graphics layers. | 68 // not create graphics layers. |
| 69 m_webView->settings()->setAcceleratedCompositingEnabled(false); | 69 m_webView->settings()->setAcceleratedCompositingEnabled(false); |
| 70 m_mainFrame = | 70 m_mainFrame = WebLocalFrame::create(WebTreeScopeType::Document, |
| 71 WebLocalFrame::create(WebTreeScopeType::Document, &m_webFrameClient); | 71 &m_webFrameClient, nullptr, nullptr); |
| 72 m_webView->setMainFrame(m_mainFrame); | 72 m_webView->setMainFrame(m_mainFrame); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void TearDown() override { m_webView->close(); } | 75 void TearDown() override { m_webView->close(); } |
| 76 | 76 |
| 77 WebString userAgent() { | 77 WebString userAgent() { |
| 78 // The test always returns the same user agent . | 78 // The test always returns the same user agent . |
| 79 WTF::CString userAgent = frameLoaderClient().userAgent().utf8(); | 79 WTF::CString userAgent = frameLoaderClient().userAgent().utf8(); |
| 80 return WebString::fromUTF8(userAgent.data(), userAgent.length()); | 80 return WebString::fromUTF8(userAgent.data(), userAgent.length()); |
| 81 } | 81 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 111 Mock::VerifyAndClearExpectations(&webFrameClient()); | 111 Mock::VerifyAndClearExpectations(&webFrameClient()); |
| 112 | 112 |
| 113 // Remove the override and make sure we get the original back. | 113 // Remove the override and make sure we get the original back. |
| 114 EXPECT_CALL(webFrameClient(), userAgentOverride()) | 114 EXPECT_CALL(webFrameClient(), userAgentOverride()) |
| 115 .WillOnce(Return(WebString())); | 115 .WillOnce(Return(WebString())); |
| 116 EXPECT_TRUE(defaultUserAgent.equals(userAgent())); | 116 EXPECT_TRUE(defaultUserAgent.equals(userAgent())); |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace | 119 } // namespace |
| 120 } // namespace blink | 120 } // namespace blink |
| OLD | NEW |