Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 2715243004: [blink] Support (semi-)transparent background colors in WebView/Frame. (Closed)
Patch Set: address comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 baseURL); 428 baseURL);
429 // Expected: transparent on top of kTransparent will still be transparent. 429 // Expected: transparent on top of kTransparent will still be transparent.
430 EXPECT_EQ(kTransparent, webView->backgroundColor()); 430 EXPECT_EQ(kTransparent, webView->backgroundColor());
431 431
432 LocalFrame* frame = webView->mainFrameImpl()->frame(); 432 LocalFrame* frame = webView->mainFrameImpl()->frame();
433 // The shutdown() calls are a hack to prevent this test 433 // The shutdown() calls are a hack to prevent this test
434 // from violating invariants about frame state during navigation/detach. 434 // from violating invariants about frame state during navigation/detach.
435 frame->document()->shutdown(); 435 frame->document()->shutdown();
436 436
437 // Creating a new frame view with the background color having 0 alpha. 437 // Creating a new frame view with the background color having 0 alpha.
438 frame->createView(IntSize(1024, 768), Color::transparent, true); 438 frame->createView(IntSize(1024, 768), Color::transparent);
439 EXPECT_EQ(kTransparent, frame->view()->baseBackgroundColor()); 439 EXPECT_EQ(kTransparent, frame->view()->baseBackgroundColor());
440 frame->view()->dispose(); 440 frame->view()->dispose();
441 441
442 const Color transparentRed(100, 0, 0, 0); 442 const Color transparentRed(100, 0, 0, 0);
443 frame->createView(IntSize(1024, 768), transparentRed, true); 443 frame->createView(IntSize(1024, 768), transparentRed);
444 EXPECT_EQ(transparentRed, frame->view()->baseBackgroundColor()); 444 EXPECT_EQ(transparentRed, frame->view()->baseBackgroundColor());
445 frame->view()->dispose(); 445 frame->view()->dispose();
446 } 446 }
447 447
448 TEST_P(WebViewTest, SetBaseBackgroundColorBeforeMainFrame) { 448 TEST_P(WebViewTest, SetBaseBackgroundColorBeforeMainFrame) {
449 const WebColor kBlue = 0xFF0000FF; 449 const WebColor kBlue = 0xFF0000FF;
450 FrameTestHelpers::TestWebViewClient webViewClient; 450 FrameTestHelpers::TestWebViewClient webViewClient;
451 WebViewImpl* webView = 451 WebViewImpl* webView =
452 WebViewImpl::create(&webViewClient, WebPageVisibilityStateVisible); 452 WebViewImpl::create(&webViewClient, WebPageVisibilityStateVisible);
453 EXPECT_NE(kBlue, webView->backgroundColor()); 453 EXPECT_NE(kBlue, webView->backgroundColor());
(...skipping 3974 matching lines...) Expand 10 before | Expand all | Expand 10 after
4428 EXPECT_FALSE(frameView->visualViewportSuppliesScrollbars()); 4428 EXPECT_FALSE(frameView->visualViewportSuppliesScrollbars());
4429 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { 4429 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
4430 EXPECT_NE(nullptr, 4430 EXPECT_NE(nullptr,
4431 frameView->layoutViewportScrollableArea()->verticalScrollbar()); 4431 frameView->layoutViewportScrollableArea()->verticalScrollbar());
4432 } else { 4432 } else {
4433 EXPECT_NE(nullptr, frameView->verticalScrollbar()); 4433 EXPECT_NE(nullptr, frameView->verticalScrollbar());
4434 } 4434 }
4435 } 4435 }
4436 4436
4437 } // namespace blink 4437 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698