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 "chrome/browser/extensions/bundle_installer.h" | 10 #include "chrome/browser/extensions/bundle_installer.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 command_line, gfx::kGLImplementationOSMesaName)) << | 238 command_line, gfx::kGLImplementationOSMesaName)) << |
239 "kUseGL must not be set multiple times!"; | 239 "kUseGL must not be set multiple times!"; |
240 #endif | 240 #endif |
241 } | 241 } |
242 | 242 |
243 protected: | 243 protected: |
244 void RunTest(bool webgl_allowed) { | 244 void RunTest(bool webgl_allowed) { |
245 static const char kEmptyArgs[] = "[]"; | 245 static const char kEmptyArgs[] = "[]"; |
246 static const char kWebGLStatusAllowed[] = "webgl_allowed"; | 246 static const char kWebGLStatusAllowed[] = "webgl_allowed"; |
247 static const char kWebGLStatusBlocked[] = "webgl_blocked"; | 247 static const char kWebGLStatusBlocked[] = "webgl_blocked"; |
248 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnResult( | 248 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( |
249 new GetWebGLStatusFunction(), kEmptyArgs, browser())); | 249 new GetWebGLStatusFunction(), kEmptyArgs, browser())); |
250 EXPECT_EQ(base::Value::TYPE_STRING, result->GetType()); | 250 EXPECT_EQ(base::Value::TYPE_STRING, result->GetType()); |
251 StringValue* value = static_cast<StringValue*>(result.get()); | 251 StringValue* value = static_cast<StringValue*>(result.get()); |
252 std::string webgl_status = ""; | 252 std::string webgl_status = ""; |
253 EXPECT_TRUE(value && value->GetAsString(&webgl_status)); | 253 EXPECT_TRUE(value && value->GetAsString(&webgl_status)); |
254 EXPECT_STREQ(webgl_allowed ? kWebGLStatusAllowed : kWebGLStatusBlocked, | 254 EXPECT_STREQ(webgl_allowed ? kWebGLStatusAllowed : kWebGLStatusBlocked, |
255 webgl_status.c_str()); | 255 webgl_status.c_str()); |
256 } | 256 } |
257 }; | 257 }; |
258 | 258 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 blacklist->UpdateGpuDataManager(); | 452 blacklist->UpdateGpuDataManager(); |
453 GpuFeatureType type = | 453 GpuFeatureType type = |
454 content::GpuDataManager::GetInstance()->GetGpuFeatureType(); | 454 content::GpuDataManager::GetInstance()->GetGpuFeatureType(); |
455 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_WEBGL); | 455 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_WEBGL); |
456 | 456 |
457 bool webgl_allowed = false; | 457 bool webgl_allowed = false; |
458 RunTest(webgl_allowed); | 458 RunTest(webgl_allowed); |
459 } | 459 } |
460 | 460 |
461 } // namespace extensions | 461 } // namespace extensions |
OLD | NEW |