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

Unified Diff: content/browser/gpu/gpu_blacklist_unittest.cc

Issue 9959085: Make it possible to blacklist gpu's based on the Windows experience index. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1025/src/
Patch Set: Created 8 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
« no previous file with comments | « content/browser/gpu/gpu_blacklist.cc ('k') | content/browser/gpu/gpu_data_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_blacklist_unittest.cc
===================================================================
--- content/browser/gpu/gpu_blacklist_unittest.cc (revision 130192)
+++ content/browser/gpu/gpu_blacklist_unittest.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -33,6 +33,9 @@
gpu_info_.driver_date = "7-14-2009";
gpu_info_.gl_vendor = "NVIDIA Corporation";
gpu_info_.gl_renderer = "NVIDIA GeForce GT 120 OpenGL Engine";
+ gpu_info_.performance_stats.graphics = 5.0;
+ gpu_info_.performance_stats.gaming = 5.0;
+ gpu_info_.performance_stats.overall = 5.0;
}
void TearDown() {
@@ -654,6 +657,93 @@
static_cast<uint32>(GpuFeatureFlags::kGpuFeatureWebgl));
}
+TEST_F(GpuBlacklistTest, PerfGraphics) {
+ const std::string json =
+ "{\n"
+ " \"name\": \"gpu blacklist\",\n"
+ " \"version\": \"0.1\",\n"
+ " \"entries\": [\n"
+ " {\n"
+ " \"id\": 1,\n"
+ " \"perf_graphics\": {\n"
+ " \"op\": \"<\",\n"
+ " \"value\": \"6.0\"\n"
+ " },\n"
+ " \"blacklist\": [\n"
+ " \"webgl\"\n"
+ " ]\n"
+ " }\n"
+ " ]\n"
+ "}";
+ scoped_ptr<Version> os_version(Version::GetVersionFromString("10.6.4"));
+
+ GpuBlacklist blacklist("1.0");
+ EXPECT_TRUE(
+ blacklist.LoadGpuBlacklist(json, GpuBlacklist::kAllOs));
+ GpuFeatureFlags flags = blacklist.DetermineGpuFeatureFlags(
+ GpuBlacklist::kOsWin, os_version.get(), gpu_info());
+ EXPECT_EQ(flags.flags(),
+ static_cast<uint32>(GpuFeatureFlags::kGpuFeatureWebgl));
+}
+
+TEST_F(GpuBlacklistTest, PerfGaming) {
+ const std::string json =
+ "{\n"
+ " \"name\": \"gpu blacklist\",\n"
+ " \"version\": \"0.1\",\n"
+ " \"entries\": [\n"
+ " {\n"
+ " \"id\": 1,\n"
+ " \"perf_gaming\": {\n"
+ " \"op\": \"<=\",\n"
+ " \"value\": \"4.0\"\n"
+ " },\n"
+ " \"blacklist\": [\n"
+ " \"webgl\"\n"
+ " ]\n"
+ " }\n"
+ " ]\n"
+ "}";
+ scoped_ptr<Version> os_version(Version::GetVersionFromString("10.6.4"));
+
+ GpuBlacklist blacklist("1.0");
+ EXPECT_TRUE(
+ blacklist.LoadGpuBlacklist(json, GpuBlacklist::kAllOs));
+ GpuFeatureFlags flags = blacklist.DetermineGpuFeatureFlags(
+ GpuBlacklist::kOsWin, os_version.get(), gpu_info());
+ EXPECT_EQ(flags.flags(), 0u);
+}
+
+TEST_F(GpuBlacklistTest, PerfOverall) {
+ const std::string json =
+ "{\n"
+ " \"name\": \"gpu blacklist\",\n"
+ " \"version\": \"0.1\",\n"
+ " \"entries\": [\n"
+ " {\n"
+ " \"id\": 1,\n"
+ " \"perf_overall\": {\n"
+ " \"op\": \"between\",\n"
+ " \"value\": \"1.0\",\n"
+ " \"value2\": \"9.0\"\n"
+ " },\n"
+ " \"blacklist\": [\n"
+ " \"webgl\"\n"
+ " ]\n"
+ " }\n"
+ " ]\n"
+ "}";
+ scoped_ptr<Version> os_version(Version::GetVersionFromString("10.6.4"));
+
+ GpuBlacklist blacklist("1.0");
+ EXPECT_TRUE(
+ blacklist.LoadGpuBlacklist(json, GpuBlacklist::kAllOs));
+ GpuFeatureFlags flags = blacklist.DetermineGpuFeatureFlags(
+ GpuBlacklist::kOsWin, os_version.get(), gpu_info());
+ EXPECT_EQ(flags.flags(),
+ static_cast<uint32>(GpuFeatureFlags::kGpuFeatureWebgl));
+}
+
TEST_F(GpuBlacklistTest, DisabledEntry) {
const std::string disabled_json =
"{\n"
« no previous file with comments | « content/browser/gpu/gpu_blacklist.cc ('k') | content/browser/gpu/gpu_data_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698