Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc

Issue 21046003: Move webstore_private API functions registrations out of ExtensionFunctionRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698