| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 MOCK_METHOD0(userAgentOverride, WebString()); | 56 MOCK_METHOD0(userAgentOverride, WebString()); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 class FrameLoaderClientImplTest : public ::testing::Test { | 59 class FrameLoaderClientImplTest : public ::testing::Test { |
| 60 protected: | 60 protected: |
| 61 void SetUp() override | 61 void SetUp() override |
| 62 { | 62 { |
| 63 ON_CALL(m_webFrameClient, userAgentOverride()).WillByDefault(Return(WebS
tring())); | 63 ON_CALL(m_webFrameClient, userAgentOverride()).WillByDefault(Return(WebS
tring())); |
| 64 | 64 |
| 65 FrameTestHelpers::TestWebViewClient webViewClient; | 65 FrameTestHelpers::TestWebViewClient webViewClient; |
| 66 m_webView = WebView::create(&webViewClient); | 66 m_webView = WebView::create(&webViewClient, WebPageVisibilityStateVisibl
e); |
| 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 = WebLocalFrame::create(WebTreeScopeType::Document, &m_webFr
ameClient); | 70 m_mainFrame = WebLocalFrame::create(WebTreeScopeType::Document, &m_webFr
ameClient); |
| 71 m_webView->setMainFrame(m_mainFrame); | 71 m_webView->setMainFrame(m_mainFrame); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void TearDown() override | 74 void TearDown() override |
| 75 { | 75 { |
| 76 m_webView->close(); | 76 m_webView->close(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 105 EXPECT_TRUE(overrideUserAgent.equals(userAgent())); | 105 EXPECT_TRUE(overrideUserAgent.equals(userAgent())); |
| 106 Mock::VerifyAndClearExpectations(&webFrameClient()); | 106 Mock::VerifyAndClearExpectations(&webFrameClient()); |
| 107 | 107 |
| 108 // Remove the override and make sure we get the original back. | 108 // Remove the override and make sure we get the original back. |
| 109 EXPECT_CALL(webFrameClient(), userAgentOverride()).WillOnce(Return(WebString
())); | 109 EXPECT_CALL(webFrameClient(), userAgentOverride()).WillOnce(Return(WebString
())); |
| 110 EXPECT_TRUE(defaultUserAgent.equals(userAgent())); | 110 EXPECT_TRUE(defaultUserAgent.equals(userAgent())); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace | 113 } // namespace |
| 114 } // namespace blink | 114 } // namespace blink |
| OLD | NEW |