| 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 278 |
| 279 TEST_F(WebViewTest, SetBaseBackgroundColorBeforeMainFrame) | 279 TEST_F(WebViewTest, SetBaseBackgroundColorBeforeMainFrame) |
| 280 { | 280 { |
| 281 const WebColor kBlue = 0xFF0000FF; | 281 const WebColor kBlue = 0xFF0000FF; |
| 282 FrameTestHelpers::TestWebViewClient webViewClient; | 282 FrameTestHelpers::TestWebViewClient webViewClient; |
| 283 WebView* webView = WebViewImpl::create(&webViewClient); | 283 WebView* webView = WebViewImpl::create(&webViewClient); |
| 284 EXPECT_NE(kBlue, webView->backgroundColor()); | 284 EXPECT_NE(kBlue, webView->backgroundColor()); |
| 285 // webView does not have a frame yet, but we should still be able to set the
background color. | 285 // webView does not have a frame yet, but we should still be able to set the
background color. |
| 286 webView->setBaseBackgroundColor(kBlue); | 286 webView->setBaseBackgroundColor(kBlue); |
| 287 EXPECT_EQ(kBlue, webView->backgroundColor()); | 287 EXPECT_EQ(kBlue, webView->backgroundColor()); |
| 288 webView->setMainFrame(WebLocalFrameImpl::create(0)); | 288 WebLocalFrameImpl* frame = WebLocalFrameImpl::create(0); |
| 289 webView->setMainFrame(frame); |
| 289 webView->close(); | 290 webView->close(); |
| 291 frame->close(); |
| 290 } | 292 } |
| 291 | 293 |
| 292 TEST_F(WebViewTest, SetBaseBackgroundColorAndBlendWithExistingContent) | 294 TEST_F(WebViewTest, SetBaseBackgroundColorAndBlendWithExistingContent) |
| 293 { | 295 { |
| 294 const WebColor kAlphaRed = 0x80FF0000; | 296 const WebColor kAlphaRed = 0x80FF0000; |
| 295 const WebColor kAlphaGreen = 0x8000FF00; | 297 const WebColor kAlphaGreen = 0x8000FF00; |
| 296 const int kWidth = 100; | 298 const int kWidth = 100; |
| 297 const int kHeight = 100; | 299 const int kHeight = 100; |
| 298 | 300 |
| 299 WebView* webView = m_webViewHelper.initialize(); | 301 WebView* webView = m_webViewHelper.initialize(); |
| (...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2179 loadFrame(webView->mainFrame(), url); | 2181 loadFrame(webView->mainFrame(), url); |
| 2180 | 2182 |
| 2181 FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl()->frame
View(); | 2183 FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl()->frame
View(); |
| 2182 | 2184 |
| 2183 // Auto-resizing used to ASSERT(needsLayout()) in RenderBlockFlow::layout. T
his EXPECT is | 2185 // Auto-resizing used to ASSERT(needsLayout()) in RenderBlockFlow::layout. T
his EXPECT is |
| 2184 // merely a dummy. The real test is that we don't trigger asserts in debug b
uilds. | 2186 // merely a dummy. The real test is that we don't trigger asserts in debug b
uilds. |
| 2185 EXPECT_FALSE(frameView->needsLayout()); | 2187 EXPECT_FALSE(frameView->needsLayout()); |
| 2186 }; | 2188 }; |
| 2187 | 2189 |
| 2188 } // namespace | 2190 } // namespace |
| OLD | NEW |