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

Unified Diff: gpu/config/gpu_driver_bug_list_unittest.cc

Issue 57633007: Merge gpu_switching_list into gpu_driver_bug_list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final final Created 7 years, 1 month 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 | « gpu/config/gpu_driver_bug_list_json.cc ('k') | gpu/config/gpu_driver_bug_workaround_type.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_driver_bug_list_unittest.cc
diff --git a/gpu/config/gpu_driver_bug_list_unittest.cc b/gpu/config/gpu_driver_bug_list_unittest.cc
index 597e730fa93afb8673ff9f31824accbb6950a8fc..1a5590c556b72ba6742bc1e47f5b50025be21ae6 100644
--- a/gpu/config/gpu_driver_bug_list_unittest.cc
+++ b/gpu/config/gpu_driver_bug_list_unittest.cc
@@ -10,6 +10,8 @@
#include "gpu/config/gpu_info.h"
#include "testing/gtest/include/gtest/gtest.h"
+#define LONG_STRING_CONST(...) #__VA_ARGS__
+
namespace gpu {
class GpuDriverBugListTest : public testing::Test {
@@ -74,5 +76,54 @@ TEST_F(GpuDriverBugListTest, CurrentListForImagination) {
EXPECT_EQ(1u, bugs.count(USE_CLIENT_SIDE_ARRAYS_FOR_STREAM_BUFFERS));
}
+TEST_F(GpuDriverBugListTest, GpuSwitching) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "name": "gpu driver bug list",
+ "version": "0.1",
+ "entries": [
+ {
+ "id": 1,
+ "os": {
+ "type": "macosx"
+ },
+ "features": [
+ "force_discrete_gpu"
+ ]
+ },
+ {
+ "id": 2,
+ "os": {
+ "type": "win"
+ },
+ "features": [
+ "force_integrated_gpu"
+ ]
+ }
+ ]
+ }
+ );
+ scoped_ptr<GpuDriverBugList> driver_bug_list(GpuDriverBugList::Create());
+ EXPECT_TRUE(driver_bug_list->LoadList(json, GpuControlList::kAllOs));
+ std::set<int> switching = driver_bug_list->MakeDecision(
+ GpuControlList::kOsMacosx, "10.8", gpu_info());
+ EXPECT_EQ(1u, switching.size());
+ EXPECT_EQ(1u, switching.count(FORCE_DISCRETE_GPU));
+ std::vector<uint32> entries;
+ driver_bug_list->GetDecisionEntries(&entries, false);
+ ASSERT_EQ(1u, entries.size());
+ EXPECT_EQ(1u, entries[0]);
+
+ driver_bug_list.reset(GpuDriverBugList::Create());
+ EXPECT_TRUE(driver_bug_list->LoadList(json, GpuControlList::kAllOs));
+ switching = driver_bug_list->MakeDecision(
+ GpuControlList::kOsWin, "6.1", gpu_info());
+ EXPECT_EQ(1u, switching.size());
+ EXPECT_EQ(1u, switching.count(FORCE_INTEGRATED_GPU));
+ driver_bug_list->GetDecisionEntries(&entries, false);
+ ASSERT_EQ(1u, entries.size());
+ EXPECT_EQ(2u, entries[0]);
+}
+
} // namespace gpu
« no previous file with comments | « gpu/config/gpu_driver_bug_list_json.cc ('k') | gpu/config/gpu_driver_bug_workaround_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698