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/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 void RunTest(bool webgl_allowed) { | 241 void RunTest(bool webgl_allowed) { |
242 static const char kEmptyArgs[] = "[]"; | 242 static const char kEmptyArgs[] = "[]"; |
243 static const char kWebGLStatusAllowed[] = "webgl_allowed"; | 243 static const char kWebGLStatusAllowed[] = "webgl_allowed"; |
244 static const char kWebGLStatusBlocked[] = "webgl_blocked"; | 244 static const char kWebGLStatusBlocked[] = "webgl_blocked"; |
245 scoped_refptr<GetWebGLStatusFunction> function = | 245 scoped_refptr<GetWebGLStatusFunction> function = |
246 new GetWebGLStatusFunction(); | 246 new GetWebGLStatusFunction(); |
247 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( | 247 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( |
248 function.get(), kEmptyArgs, browser())); | 248 function.get(), kEmptyArgs, browser())); |
249 ASSERT_TRUE(result); | 249 ASSERT_TRUE(result); |
250 EXPECT_EQ(base::Value::TYPE_STRING, result->GetType()); | 250 EXPECT_EQ(base::Value::TYPE_STRING, result->GetType()); |
251 std::string webgl_status = ""; | 251 std::string webgl_status; |
252 EXPECT_TRUE(result->GetAsString(&webgl_status)); | 252 EXPECT_TRUE(result->GetAsString(&webgl_status)); |
253 EXPECT_STREQ(webgl_allowed ? kWebGLStatusAllowed : kWebGLStatusBlocked, | 253 EXPECT_STREQ(webgl_allowed ? kWebGLStatusAllowed : kWebGLStatusBlocked, |
254 webgl_status.c_str()); | 254 webgl_status.c_str()); |
255 } | 255 } |
256 }; | 256 }; |
257 | 257 |
258 // Test cases for webstore origin frame blocking. | 258 // Test cases for webstore origin frame blocking. |
259 // TODO(mkwst): Disabled until new X-Frame-Options behavior rolls into | 259 // TODO(mkwst): Disabled until new X-Frame-Options behavior rolls into |
260 // Chromium, see crbug.com/226018. | 260 // Chromium, see crbug.com/226018. |
261 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, | 261 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 content::GpuDataManager::GetInstance()->InitializeForTesting( | 482 content::GpuDataManager::GetInstance()->InitializeForTesting( |
483 json_blacklist, gpu_info); | 483 json_blacklist, gpu_info); |
484 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( | 484 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( |
485 content::GPU_FEATURE_TYPE_WEBGL)); | 485 content::GPU_FEATURE_TYPE_WEBGL)); |
486 | 486 |
487 bool webgl_allowed = false; | 487 bool webgl_allowed = false; |
488 RunTest(webgl_allowed); | 488 RunTest(webgl_allowed); |
489 } | 489 } |
490 | 490 |
491 } // namespace extensions | 491 } // namespace extensions |
OLD | NEW |