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

Unified Diff: chrome/browser/gpu_blacklist_unittest.cc

Issue 6352011: Improve blacklist logic: use more fields (driver_vendor, gl_renderer, ect) fo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « chrome/browser/gpu_blacklist.cc ('k') | chrome/browser/gpu_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gpu_blacklist_unittest.cc
===================================================================
--- chrome/browser/gpu_blacklist_unittest.cc (revision 72173)
+++ chrome/browser/gpu_blacklist_unittest.cc (working copy)
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <vector>
+
#include "base/version.h"
#include "chrome/browser/gpu_blacklist.h"
#include "chrome/common/gpu_info.h"
@@ -27,11 +29,15 @@
const std::string empty_list_json =
"{\n"
" \"name\": \"gpu blacklist\",\n"
- " \"version\": \"0.0\",\n"
+ " \"version\": \"2.5\",\n"
" \"entries\": [\n"
" ]\n"
"}";
EXPECT_TRUE(blacklist.LoadGpuBlacklist(empty_list_json, false));
+ uint16 major, minor;
+ EXPECT_TRUE(blacklist.GetVersion(&major, &minor));
+ EXPECT_EQ(major, 2u);
+ EXPECT_EQ(minor, 5u);
flags = blacklist.DetermineGpuFeatureFlags(
GpuBlacklist::kOsMacosx, os_version.get(), gpu_info);
EXPECT_EQ(flags.flags(), 0u);
@@ -43,6 +49,7 @@
" \"version\": \"0.1\",\n"
" \"entries\": [\n"
" {\n"
+ " \"id\": \"5\",\n"
" \"os\": {\n"
" \"type\": \"macosx\",\n"
" \"version\": {\n"
@@ -77,6 +84,16 @@
EXPECT_EQ(
flags.flags(),
static_cast<uint32>(GpuFeatureFlags::kGpuFeatureAcceleratedCompositing));
+ std::vector<uint32> entries;
+ blacklist.GetGpuFeatureFlagEntries(
+ GpuFeatureFlags::kGpuFeatureAcceleratedCompositing, entries);
+ EXPECT_EQ(entries.size(), 1u);
+ EXPECT_EQ(entries[0], 5u);
+ blacklist.GetGpuFeatureFlagEntries(
+ GpuFeatureFlags::kGpuFeatureAll, entries);
+ EXPECT_EQ(entries.size(), 1u);
+ EXPECT_EQ(entries[0], 5u);
+ EXPECT_EQ(blacklist.max_entry_id(), 5u);
// Blacklist a vendor on all OS.
const std::string vendor_json =
@@ -85,6 +102,7 @@
" \"version\": \"0.1\",\n"
" \"entries\": [\n"
" {\n"
+ " \"id\": \"1\",\n"
" \"vendor_id\": \"0x10de\",\n"
" \"blacklist\": [\n"
" \"webgl\"\n"
@@ -113,6 +131,7 @@
" \"version\": \"0.1\",\n"
" \"entries\": [\n"
" {\n"
+ " \"id\": \"1\",\n"
" \"os\": {\n"
" \"type\": \"linux\"\n"
" },\n"
« no previous file with comments | « chrome/browser/gpu_blacklist.cc ('k') | chrome/browser/gpu_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698