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

Side by Side Diff: gpu/config/gpu_control_list_unittest.cc

Issue 1247093006: Allow WebGL on Android if the GPU has it's own process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test suggested by zmo@ Created 5 years, 5 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 unified diff | Download patch
OLDNEW
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
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 "exceptions": [
642 {
643 "in_process_gpu": false
644 }
645 ],
646 "features": [
647 "test_feature_0"
648 ]
649 }
650 ]
651 }
652 );
653 scoped_ptr<GpuControlList> control_list(Create());
654
655 EXPECT_TRUE(control_list->LoadList(exact_list_json, GpuControlList::kAllOs));
656 GPUInfo gpu_info;
657
658 gpu_info.in_process_gpu = true;
659 std::set<int> features = control_list->MakeDecision(
660 GpuControlList::kOsWin, kOsVersion, gpu_info);
661 EXPECT_SINGLE_FEATURE(features, TEST_FEATURE_0);
662
663 gpu_info.in_process_gpu = false;
664 features = control_list->MakeDecision(
665 GpuControlList::kOsWin, kOsVersion, gpu_info);
666 EXPECT_EMPTY_SET(features);
667 }
668
630 } // namespace gpu 669 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/config/gpu_control_list.cc ('k') | gpu/config/gpu_info.h » ('j') | gpu/config/gpu_info.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698