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_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 command_line, gfx::kGLImplementationOSMesaName)) << | 321 command_line, gfx::kGLImplementationOSMesaName)) << |
322 "kUseGL must not be set multiple times!"; | 322 "kUseGL must not be set multiple times!"; |
323 #endif | 323 #endif |
324 } | 324 } |
325 | 325 |
326 protected: | 326 protected: |
327 void RunTest(bool webgl_allowed) { | 327 void RunTest(bool webgl_allowed) { |
328 static const char kEmptyArgs[] = "[]"; | 328 static const char kEmptyArgs[] = "[]"; |
329 static const char kWebGLStatusAllowed[] = "webgl_allowed"; | 329 static const char kWebGLStatusAllowed[] = "webgl_allowed"; |
330 static const char kWebGLStatusBlocked[] = "webgl_blocked"; | 330 static const char kWebGLStatusBlocked[] = "webgl_blocked"; |
331 scoped_refptr<GetWebGLStatusFunction> function = | 331 scoped_refptr<WebstorePrivateGetWebGLStatusFunction> function = |
332 new GetWebGLStatusFunction(); | 332 new WebstorePrivateGetWebGLStatusFunction(); |
333 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( | 333 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( |
334 function.get(), kEmptyArgs, browser())); | 334 function.get(), kEmptyArgs, browser())); |
335 ASSERT_TRUE(result); | 335 ASSERT_TRUE(result); |
336 EXPECT_EQ(base::Value::TYPE_STRING, result->GetType()); | 336 EXPECT_EQ(base::Value::TYPE_STRING, result->GetType()); |
337 std::string webgl_status; | 337 std::string webgl_status; |
338 EXPECT_TRUE(result->GetAsString(&webgl_status)); | 338 EXPECT_TRUE(result->GetAsString(&webgl_status)); |
339 EXPECT_STREQ(webgl_allowed ? kWebGLStatusAllowed : kWebGLStatusBlocked, | 339 EXPECT_STREQ(webgl_allowed ? kWebGLStatusAllowed : kWebGLStatusBlocked, |
340 webgl_status.c_str()); | 340 webgl_status.c_str()); |
341 } | 341 } |
342 }; | 342 }; |
(...skipping 23 matching lines...) Expand all Loading... |
366 content::GpuDataManager::GetInstance()->InitializeForTesting( | 366 content::GpuDataManager::GetInstance()->InitializeForTesting( |
367 json_blacklist, gpu_info); | 367 json_blacklist, gpu_info); |
368 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( | 368 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( |
369 gpu::GPU_FEATURE_TYPE_WEBGL)); | 369 gpu::GPU_FEATURE_TYPE_WEBGL)); |
370 | 370 |
371 bool webgl_allowed = false; | 371 bool webgl_allowed = false; |
372 RunTest(webgl_allowed); | 372 RunTest(webgl_allowed); |
373 } | 373 } |
374 | 374 |
375 } // namespace extensions | 375 } // namespace extensions |
OLD | NEW |