| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 command_line, gfx::kGLImplementationOSMesaName)) << | 232 command_line, gfx::kGLImplementationOSMesaName)) << |
| 233 "kUseGL must not be set multiple times!"; | 233 "kUseGL must not be set multiple times!"; |
| 234 #endif | 234 #endif |
| 235 } | 235 } |
| 236 | 236 |
| 237 protected: | 237 protected: |
| 238 void RunTest(bool webgl_allowed) { | 238 void RunTest(bool webgl_allowed) { |
| 239 static const char kEmptyArgs[] = "[]"; | 239 static const char kEmptyArgs[] = "[]"; |
| 240 static const char kWebGLStatusAllowed[] = "webgl_allowed"; | 240 static const char kWebGLStatusAllowed[] = "webgl_allowed"; |
| 241 static const char kWebGLStatusBlocked[] = "webgl_blocked"; | 241 static const char kWebGLStatusBlocked[] = "webgl_blocked"; |
| 242 scoped_refptr<GetWebGLStatusFunction> function = | 242 scoped_refptr<WebstorePrivateGetWebGLStatusFunction> function = |
| 243 new GetWebGLStatusFunction(); | 243 new WebstorePrivateGetWebGLStatusFunction(); |
| 244 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( | 244 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( |
| 245 function.get(), kEmptyArgs, browser())); | 245 function.get(), kEmptyArgs, browser())); |
| 246 ASSERT_TRUE(result); | 246 ASSERT_TRUE(result); |
| 247 EXPECT_EQ(base::Value::TYPE_STRING, result->GetType()); | 247 EXPECT_EQ(base::Value::TYPE_STRING, result->GetType()); |
| 248 std::string webgl_status = ""; | 248 std::string webgl_status = ""; |
| 249 EXPECT_TRUE(result->GetAsString(&webgl_status)); | 249 EXPECT_TRUE(result->GetAsString(&webgl_status)); |
| 250 EXPECT_STREQ(webgl_allowed ? kWebGLStatusAllowed : kWebGLStatusBlocked, | 250 EXPECT_STREQ(webgl_allowed ? kWebGLStatusAllowed : kWebGLStatusBlocked, |
| 251 webgl_status.c_str()); | 251 webgl_status.c_str()); |
| 252 } | 252 } |
| 253 }; | 253 }; |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 GpuFeatureType type = | 469 GpuFeatureType type = |
| 470 content::GpuDataManager::GetInstance()->GetBlacklistedFeatures(); | 470 content::GpuDataManager::GetInstance()->GetBlacklistedFeatures(); |
| 471 EXPECT_EQ((type & content::GPU_FEATURE_TYPE_WEBGL), | 471 EXPECT_EQ((type & content::GPU_FEATURE_TYPE_WEBGL), |
| 472 content::GPU_FEATURE_TYPE_WEBGL); | 472 content::GPU_FEATURE_TYPE_WEBGL); |
| 473 | 473 |
| 474 bool webgl_allowed = false; | 474 bool webgl_allowed = false; |
| 475 RunTest(webgl_allowed); | 475 RunTest(webgl_allowed); |
| 476 } | 476 } |
| 477 | 477 |
| 478 } // namespace extensions | 478 } // namespace extensions |
| OLD | NEW |