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

Unified Diff: content/browser/web_contents/web_contents_view_aura_unittest.cc

Issue 2742383006: Display: set color_depth and depth_per_component value based on kEnableHDROutput (Closed)
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_view_aura_unittest.cc
diff --git a/content/browser/web_contents/web_contents_view_aura_unittest.cc b/content/browser/web_contents/web_contents_view_aura_unittest.cc
index 504ac2b6914a1623d386f7b5a6bcd1c0eeafe409..97ad227840e081d2ac1a2b4ecbadcd365a876819 100644
--- a/content/browser/web_contents/web_contents_view_aura_unittest.cc
+++ b/content/browser/web_contents/web_contents_view_aura_unittest.cc
@@ -4,16 +4,19 @@
#include "content/browser/web_contents/web_contents_view_aura.h"
+#include "base/command_line.h"
+#include "base/test/scoped_command_line.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/test/test_renderer_host.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/display/display_switches.h"
namespace content {
class WebContentsViewAuraTest : public RenderViewHostTestHarness {
public:
- WebContentsViewAuraTest() {}
- ~WebContentsViewAuraTest() override {}
+ WebContentsViewAuraTest() = default;
+ ~WebContentsViewAuraTest() override = default;
WebContentsViewAura* view() {
WebContentsImpl* contents = static_cast<WebContentsImpl*>(web_contents());
@@ -29,4 +32,39 @@ TEST_F(WebContentsViewAuraTest, EnableDisableOverscroll) {
EXPECT_TRUE(wcva->navigation_overlay_);
}
+TEST_F(WebContentsViewAuraTest, ScreenInfoColorDepth) {
+ WebContentsView* web_contents_view = view();
+
+ ScreenInfo screen_info;
+ web_contents_view->GetScreenInfo(&screen_info);
+ EXPECT_EQ(24u, screen_info.depth);
+ EXPECT_EQ(8u, screen_info.depth_per_component);
+}
+
+// This test class is used when we want to have the kEnableHDROutput flag on.
+class WebContentsViewAuraHDRTest : public WebContentsViewAuraTest {
+ public:
+ WebContentsViewAuraHDRTest() = default;
+ ~WebContentsViewAuraHDRTest() override = default;
+
+ void SetUp() override {
+ base::CommandLine* command_line =
+ scoped_command_line_.GetProcessCommandLine();
+ command_line->AppendSwitch(switches::kEnableHDR);
+ WebContentsViewAuraTest::SetUp();
+ }
+
+ private:
+ base::test::ScopedCommandLine scoped_command_line_;
+};
+
+TEST_F(WebContentsViewAuraHDRTest, ScreenInfoColorDepth) {
+ WebContentsView* web_contents_view = view();
+
+ ScreenInfo screen_info;
+ web_contents_view->GetScreenInfo(&screen_info);
+ EXPECT_EQ(48u, screen_info.depth);
+ EXPECT_EQ(16u, screen_info.depth_per_component);
+}
+
} // namespace content
« no previous file with comments | « content/browser/web_contents/web_contents_view_aura.cc ('k') | content/renderer/media/render_media_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698