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

Side by Side Diff: content/browser/gpu/gpu_data_manager_impl_private_unittest.cc

Issue 1885023002: Set GpuPreferences correctly in GpuDataManagerImplPrivate::AppendGpuCommandLine. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount()); 635 EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount());
636 EXPECT_TRUE(manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL)); 636 EXPECT_TRUE(manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL));
637 } 637 }
638 #endif // OS_LINUX 638 #endif // OS_LINUX
639 639
640 TEST_F(GpuDataManagerImplPrivateTest, GpuDriverBugListSingle) { 640 TEST_F(GpuDataManagerImplPrivateTest, GpuDriverBugListSingle) {
641 ScopedGpuDataManagerImplPrivate manager; 641 ScopedGpuDataManagerImplPrivate manager;
642 manager->gpu_driver_bugs_.insert(5); 642 manager->gpu_driver_bugs_.insert(5);
643 643
644 base::CommandLine command_line(0, NULL); 644 base::CommandLine command_line(0, NULL);
645 manager->AppendGpuCommandLine(&command_line); 645 manager->AppendGpuCommandLine(&command_line, nullptr);
646 646
647 EXPECT_TRUE(command_line.HasSwitch(switches::kGpuDriverBugWorkarounds)); 647 EXPECT_TRUE(command_line.HasSwitch(switches::kGpuDriverBugWorkarounds));
648 std::string args = command_line.GetSwitchValueASCII( 648 std::string args = command_line.GetSwitchValueASCII(
649 switches::kGpuDriverBugWorkarounds); 649 switches::kGpuDriverBugWorkarounds);
650 EXPECT_STREQ("5", args.c_str()); 650 EXPECT_STREQ("5", args.c_str());
651 } 651 }
652 652
653 TEST_F(GpuDataManagerImplPrivateTest, GpuDriverBugListMultiple) { 653 TEST_F(GpuDataManagerImplPrivateTest, GpuDriverBugListMultiple) {
654 ScopedGpuDataManagerImplPrivate manager; 654 ScopedGpuDataManagerImplPrivate manager;
655 manager->gpu_driver_bugs_.insert(5); 655 manager->gpu_driver_bugs_.insert(5);
656 manager->gpu_driver_bugs_.insert(7); 656 manager->gpu_driver_bugs_.insert(7);
657 657
658 base::CommandLine command_line(0, NULL); 658 base::CommandLine command_line(0, NULL);
659 manager->AppendGpuCommandLine(&command_line); 659 manager->AppendGpuCommandLine(&command_line, nullptr);
660 660
661 EXPECT_TRUE(command_line.HasSwitch(switches::kGpuDriverBugWorkarounds)); 661 EXPECT_TRUE(command_line.HasSwitch(switches::kGpuDriverBugWorkarounds));
662 std::string args = command_line.GetSwitchValueASCII( 662 std::string args = command_line.GetSwitchValueASCII(
663 switches::kGpuDriverBugWorkarounds); 663 switches::kGpuDriverBugWorkarounds);
664 EXPECT_STREQ("5,7", args.c_str()); 664 EXPECT_STREQ("5,7", args.c_str());
665 } 665 }
666 666
667 TEST_F(GpuDataManagerImplPrivateTest, BlacklistAllFeatures) { 667 TEST_F(GpuDataManagerImplPrivateTest, BlacklistAllFeatures) {
668 ScopedGpuDataManagerImplPrivate manager; 668 ScopedGpuDataManagerImplPrivate manager;
669 EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount()); 669 EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount());
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 EXPECT_TRUE(manager->UpdateActiveGpu(0x8086, 0x04a1)); 775 EXPECT_TRUE(manager->UpdateActiveGpu(0x8086, 0x04a1));
776 { 776 {
777 base::RunLoop run_loop; 777 base::RunLoop run_loop;
778 run_loop.RunUntilIdle(); 778 run_loop.RunUntilIdle();
779 } 779 }
780 EXPECT_TRUE(observer.gpu_info_updated()); 780 EXPECT_TRUE(observer.gpu_info_updated());
781 EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount()); 781 EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount());
782 } 782 }
783 783
784 } // namespace content 784 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.cc ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698