| 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 webView->setBaseBackgroundColor(kTranslucentPutty); | 377 webView->setBaseBackgroundColor(kTranslucentPutty); |
| 378 // Expected: red (50% alpha) blended atop kTranslucentPutty. Note the alpha. | 378 // Expected: red (50% alpha) blended atop kTranslucentPutty. Note the alpha. |
| 379 EXPECT_EQ(0xBFE93B32, webView->backgroundColor()); | 379 EXPECT_EQ(0xBFE93B32, webView->backgroundColor()); |
| 380 | 380 |
| 381 webView->setBaseBackgroundColor(kTransparent); | 381 webView->setBaseBackgroundColor(kTransparent); |
| 382 FrameTestHelpers::loadHTMLString(webView->mainFrame(), "<html><head><style>b
ody {background-color:transparent}</style></head></html>", baseURL); | 382 FrameTestHelpers::loadHTMLString(webView->mainFrame(), "<html><head><style>b
ody {background-color:transparent}</style></head></html>", baseURL); |
| 383 // Expected: transparent on top of kTransparent will still be transparent. | 383 // Expected: transparent on top of kTransparent will still be transparent. |
| 384 EXPECT_EQ(kTransparent, webView->backgroundColor()); | 384 EXPECT_EQ(kTransparent, webView->backgroundColor()); |
| 385 | 385 |
| 386 LocalFrame* frame = webView->mainFrameImpl()->frame(); | 386 LocalFrame* frame = webView->mainFrameImpl()->frame(); |
| 387 // The detachLayoutTree() and dispose() calls are a hack to prevent this tes
t | 387 // The shutdown() calls are a hack to prevent this test |
| 388 // from violating invariants about frame state during navigation/detach. | 388 // from violating invariants about frame state during navigation/detach. |
| 389 frame->document()->detachLayoutTree(); | 389 frame->document()->shutdown(); |
| 390 | 390 |
| 391 // Creating a new frame view with the background color having 0 alpha. | 391 // Creating a new frame view with the background color having 0 alpha. |
| 392 frame->createView(IntSize(1024, 768), Color::transparent, true); | 392 frame->createView(IntSize(1024, 768), Color::transparent, true); |
| 393 EXPECT_EQ(kTransparent, frame->view()->baseBackgroundColor()); | 393 EXPECT_EQ(kTransparent, frame->view()->baseBackgroundColor()); |
| 394 frame->view()->dispose(); | 394 frame->view()->dispose(); |
| 395 | 395 |
| 396 const Color transparentRed(100, 0, 0, 0); | 396 const Color transparentRed(100, 0, 0, 0); |
| 397 frame->createView(IntSize(1024, 768), transparentRed, true); | 397 frame->createView(IntSize(1024, 768), transparentRed, true); |
| 398 EXPECT_EQ(transparentRed, frame->view()->baseBackgroundColor()); | 398 EXPECT_EQ(transparentRed, frame->view()->baseBackgroundColor()); |
| 399 frame->view()->dispose(); | 399 frame->view()->dispose(); |
| (...skipping 2965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3365 EXPECT_TRUE(webView->page()->defersLoading()); | 3365 EXPECT_TRUE(webView->page()->defersLoading()); |
| 3366 } | 3366 } |
| 3367 | 3367 |
| 3368 EXPECT_TRUE(webView->page()->defersLoading()); | 3368 EXPECT_TRUE(webView->page()->defersLoading()); |
| 3369 } | 3369 } |
| 3370 | 3370 |
| 3371 EXPECT_FALSE(webView->page()->defersLoading()); | 3371 EXPECT_FALSE(webView->page()->defersLoading()); |
| 3372 } | 3372 } |
| 3373 | 3373 |
| 3374 } // namespace blink | 3374 } // namespace blink |
| OLD | NEW |