| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "gpu/config/gpu_control_list.h" | 8 #include "gpu/config/gpu_control_list.h" |
| 9 #include "gpu/config/gpu_info.h" | 9 #include "gpu/config/gpu_info.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 | 620 |
| 621 std::vector<std::string> disabled_extensions = | 621 std::vector<std::string> disabled_extensions = |
| 622 control_list->GetDisabledExtensions(); | 622 control_list->GetDisabledExtensions(); |
| 623 | 623 |
| 624 ASSERT_EQ(3u, disabled_extensions.size()); | 624 ASSERT_EQ(3u, disabled_extensions.size()); |
| 625 ASSERT_STREQ("test_extension1", disabled_extensions[0].c_str()); | 625 ASSERT_STREQ("test_extension1", disabled_extensions[0].c_str()); |
| 626 ASSERT_STREQ("test_extension2", disabled_extensions[1].c_str()); | 626 ASSERT_STREQ("test_extension2", disabled_extensions[1].c_str()); |
| 627 ASSERT_STREQ("test_extension3", disabled_extensions[2].c_str()); | 627 ASSERT_STREQ("test_extension3", disabled_extensions[2].c_str()); |
| 628 } | 628 } |
| 629 | 629 |
| 630 TEST_F(GpuControlListTest, DisabledInProcessGPUTest) { | |
| 631 const std::string exact_list_json = LONG_STRING_CONST( | |
| 632 { | |
| 633 "name": "gpu control list", | |
| 634 "version": "0.1", | |
| 635 "entries": [ | |
| 636 { | |
| 637 "id": 1, | |
| 638 "os": { | |
| 639 "type": "win" | |
| 640 }, | |
| 641 "in_process_gpu": true, | |
| 642 "features": [ | |
| 643 "test_feature_0" | |
| 644 ] | |
| 645 } | |
| 646 ] | |
| 647 } | |
| 648 ); | |
| 649 scoped_ptr<GpuControlList> control_list(Create()); | |
| 650 | |
| 651 EXPECT_TRUE(control_list->LoadList(exact_list_json, GpuControlList::kAllOs)); | |
| 652 GPUInfo gpu_info; | |
| 653 | |
| 654 gpu_info.in_process_gpu = true; | |
| 655 std::set<int> features = control_list->MakeDecision( | |
| 656 GpuControlList::kOsWin, kOsVersion, gpu_info); | |
| 657 EXPECT_SINGLE_FEATURE(features, TEST_FEATURE_0); | |
| 658 | |
| 659 gpu_info.in_process_gpu = false; | |
| 660 features = control_list->MakeDecision( | |
| 661 GpuControlList::kOsWin, kOsVersion, gpu_info); | |
| 662 EXPECT_EMPTY_SET(features); | |
| 663 } | |
| 664 | |
| 665 } // namespace gpu | 630 } // namespace gpu |
| OLD | NEW |