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/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 webgl_allowed = false; | 395 webgl_allowed = false; |
396 | 396 |
397 static const char kEmptyArgs[] = "[]"; | 397 static const char kEmptyArgs[] = "[]"; |
398 static const char kWebGLStatusAllowed[] = "webgl_allowed"; | 398 static const char kWebGLStatusAllowed[] = "webgl_allowed"; |
399 static const char kWebGLStatusBlocked[] = "webgl_blocked"; | 399 static const char kWebGLStatusBlocked[] = "webgl_blocked"; |
400 scoped_refptr<WebstorePrivateGetWebGLStatusFunction> function = | 400 scoped_refptr<WebstorePrivateGetWebGLStatusFunction> function = |
401 new WebstorePrivateGetWebGLStatusFunction(); | 401 new WebstorePrivateGetWebGLStatusFunction(); |
402 std::unique_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( | 402 std::unique_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( |
403 function.get(), kEmptyArgs, browser())); | 403 function.get(), kEmptyArgs, browser())); |
404 ASSERT_TRUE(result); | 404 ASSERT_TRUE(result); |
405 EXPECT_EQ(base::Value::TYPE_STRING, result->GetType()); | 405 EXPECT_EQ(base::Value::Type::STRING, result->GetType()); |
406 std::string webgl_status; | 406 std::string webgl_status; |
407 EXPECT_TRUE(result->GetAsString(&webgl_status)); | 407 EXPECT_TRUE(result->GetAsString(&webgl_status)); |
408 EXPECT_STREQ(webgl_allowed ? kWebGLStatusAllowed : kWebGLStatusBlocked, | 408 EXPECT_STREQ(webgl_allowed ? kWebGLStatusAllowed : kWebGLStatusBlocked, |
409 webgl_status.c_str()); | 409 webgl_status.c_str()); |
410 } | 410 } |
411 }; | 411 }; |
412 | 412 |
413 // Tests getWebGLStatus function when WebGL is allowed. | 413 // Tests getWebGLStatus function when WebGL is allowed. |
414 IN_PROC_BROWSER_TEST_F(ExtensionWebstoreGetWebGLStatusTest, Allowed) { | 414 IN_PROC_BROWSER_TEST_F(ExtensionWebstoreGetWebGLStatusTest, Allowed) { |
415 bool webgl_allowed = true; | 415 bool webgl_allowed = true; |
(...skipping 19 matching lines...) Expand all Loading... |
435 content::GpuDataManager::GetInstance()->InitializeForTesting( | 435 content::GpuDataManager::GetInstance()->InitializeForTesting( |
436 json_blacklist, gpu_info); | 436 json_blacklist, gpu_info); |
437 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( | 437 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( |
438 gpu::GPU_FEATURE_TYPE_WEBGL)); | 438 gpu::GPU_FEATURE_TYPE_WEBGL)); |
439 | 439 |
440 bool webgl_allowed = false; | 440 bool webgl_allowed = false; |
441 RunTest(webgl_allowed); | 441 RunTest(webgl_allowed); |
442 } | 442 } |
443 | 443 |
444 } // namespace extensions | 444 } // namespace extensions |
OLD | NEW |