diff options
author | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-21 23:42:57 +0000 |
---|---|---|
committer | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-21 23:42:57 +0000 |
commit | 7fba3e550c138bf159589476c707a7e1d536055d (patch) | |
tree | 3c895c0546e81fdd35a63533bbdf0a1881f5750a /gpu/config/gpu_blacklist_unittest.cc | |
parent | 02830cac49ac96f0c9dd8c018fb888462127cec9 (diff) | |
download | chromium_src-7fba3e550c138bf159589476c707a7e1d536055d.zip chromium_src-7fba3e550c138bf159589476c707a7e1d536055d.tar.gz chromium_src-7fba3e550c138bf159589476c707a7e1d536055d.tar.bz2 |
Revert 201380 "Move GPU device/driver info related code from con..."
> Move GPU device/driver info related code from content to gpu.
>
> This has been suggested by gman, and agreed by kbr and jam, for the following reasons:
>
> 1) These are gpu related code, and are independent of content / browser, so putting them under gpu/ is the right thing to do conceptually.
>
> 2) This enables us to set up tests in various places with the correct blacklisting/driver_bug_workarounds information. Otherwise, for the moment, gpu/ has no visibility into content/ side, so we have to duplicate the driver_bug_workarounds code and hardwire them for testing purpose. This is going to cause a lot of bugs in the future, as we have the two pieces of code for the same thing (one for chrome and one for testing) and people will easily forget to update one or the other.
>
> As for this patch, I didn't change the logic, and try to minimize the refactoring. All improvements enabled by this relocation will be done in follow-up CLs.
>
> BUG=230477
> TEST=tree
> TBR=gman@chromium.org, joi@chromium.org, kbr@chromium.org, piman@chromium.org
>
> Review URL: https://codereview.chromium.org/15385003
TBR=zmo@chromium.org
Review URL: https://codereview.chromium.org/15619004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201386 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/config/gpu_blacklist_unittest.cc')
-rw-r--r-- | gpu/config/gpu_blacklist_unittest.cc | 143 |
1 files changed, 0 insertions, 143 deletions
diff --git a/gpu/config/gpu_blacklist_unittest.cc b/gpu/config/gpu_blacklist_unittest.cc deleted file mode 100644 index 3282437..0000000 --- a/gpu/config/gpu_blacklist_unittest.cc +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/memory/scoped_ptr.h" -#include "gpu/config/gpu_blacklist.h" -#include "gpu/config/gpu_control_list_jsons.h" -#include "gpu/config/gpu_feature_type.h" -#include "gpu/config/gpu_info.h" -#include "testing/gtest/include/gtest/gtest.h" - -const char kOsVersion[] = "10.6.4"; - -namespace gpu { - -class GpuBlacklistTest : public testing::Test { - public: - GpuBlacklistTest() { } - - virtual ~GpuBlacklistTest() { } - - const GPUInfo& gpu_info() const { - return gpu_info_; - } - - void RunFeatureTest( - const std::string feature_name, GpuFeatureType feature_type) { - const std::string json = - "{\n" - " \"name\": \"gpu blacklist\",\n" - " \"version\": \"0.1\",\n" - " \"entries\": [\n" - " {\n" - " \"id\": 1,\n" - " \"os\": {\n" - " \"type\": \"macosx\"\n" - " },\n" - " \"vendor_id\": \"0x10de\",\n" - " \"device_id\": [\"0x0640\"],\n" - " \"features\": [\n" - " \"" + - feature_name + - "\"\n" - " ]\n" - " }\n" - " ]\n" - "}"; - - scoped_ptr<GpuBlacklist> blacklist(GpuBlacklist::Create()); - EXPECT_TRUE(blacklist->LoadList(json, GpuBlacklist::kAllOs)); - std::set<int> type = blacklist->MakeDecision( - GpuBlacklist::kOsMacosx, kOsVersion, gpu_info()); - EXPECT_EQ(1u, type.size()); - EXPECT_EQ(1u, type.count(feature_type)); - } - - protected: - virtual void SetUp() { - gpu_info_.gpu.vendor_id = 0x10de; - gpu_info_.gpu.device_id = 0x0640; - gpu_info_.driver_vendor = "NVIDIA"; - gpu_info_.driver_version = "1.6.18"; - gpu_info_.driver_date = "7-14-2009"; - gpu_info_.machine_model = "MacBookPro 7.1"; - gpu_info_.gl_vendor = "NVIDIA Corporation"; - gpu_info_.gl_renderer = "NVIDIA GeForce GT 120 OpenGL Engine"; - gpu_info_.performance_stats.graphics = 5.0; - gpu_info_.performance_stats.gaming = 5.0; - gpu_info_.performance_stats.overall = 5.0; - } - - virtual void TearDown() { - } - - private: - GPUInfo gpu_info_; -}; - -TEST_F(GpuBlacklistTest, CurrentBlacklistValidation) { - scoped_ptr<GpuBlacklist> blacklist(GpuBlacklist::Create()); - EXPECT_TRUE(blacklist->LoadList( - kSoftwareRenderingListJson, GpuBlacklist::kAllOs)); - EXPECT_FALSE(blacklist->contains_unknown_fields()); -} - -#define GPU_BLACKLIST_FEATURE_TEST(test_name, feature_name, feature_type) \ -TEST_F(GpuBlacklistTest, test_name) { \ - RunFeatureTest(feature_name, feature_type); \ -} - -GPU_BLACKLIST_FEATURE_TEST(Accelerated2DCanvas, - "accelerated_2d_canvas", - GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS) - -GPU_BLACKLIST_FEATURE_TEST(AcceleratedCompositing, - "accelerated_compositing", - GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) - -GPU_BLACKLIST_FEATURE_TEST(WebGL, - "webgl", - GPU_FEATURE_TYPE_WEBGL) - -GPU_BLACKLIST_FEATURE_TEST(Multisampling, - "multisampling", - GPU_FEATURE_TYPE_MULTISAMPLING) - -GPU_BLACKLIST_FEATURE_TEST(Flash3D, - "flash_3d", - GPU_FEATURE_TYPE_FLASH3D) - -GPU_BLACKLIST_FEATURE_TEST(FlashStage3D, - "flash_stage3d", - GPU_FEATURE_TYPE_FLASH_STAGE3D) - -GPU_BLACKLIST_FEATURE_TEST(FlashStage3DBaseline, - "flash_stage3d_baseline", - GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE) - -GPU_BLACKLIST_FEATURE_TEST(TextureSharing, - "texture_sharing", - GPU_FEATURE_TYPE_TEXTURE_SHARING) - -GPU_BLACKLIST_FEATURE_TEST(AcceleratedVideoDecode, - "accelerated_video_decode", - GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) - -GPU_BLACKLIST_FEATURE_TEST(Css3D, - "3d_css", - GPU_FEATURE_TYPE_3D_CSS) - -GPU_BLACKLIST_FEATURE_TEST(AcceleratedVideo, - "accelerated_video", - GPU_FEATURE_TYPE_ACCELERATED_VIDEO) - -GPU_BLACKLIST_FEATURE_TEST(PanelFitting, - "panel_fitting", - GPU_FEATURE_TYPE_PANEL_FITTING) - -GPU_BLACKLIST_FEATURE_TEST(ForceCompositingMode, - "force_compositing_mode", - GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE) - -} // namespace gpu |