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

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

Issue 10825127: Valgrind: Clean up leaks in callers to extension_function_test_utils::RunFunction. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
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_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
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_refptr<GetWebGLStatusFunction> function =
249 new GetWebGLStatusFunction();
248 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( 250 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult(
249 new GetWebGLStatusFunction(), kEmptyArgs, browser())); 251 function.get(), kEmptyArgs, browser()));
250 EXPECT_EQ(base::Value::TYPE_STRING, result->GetType()); 252 EXPECT_EQ(base::Value::TYPE_STRING, result->GetType());
251 StringValue* value = static_cast<StringValue*>(result.get()); 253 StringValue* value = static_cast<StringValue*>(result.get());
252 std::string webgl_status = ""; 254 std::string webgl_status = "";
253 EXPECT_TRUE(value && value->GetAsString(&webgl_status)); 255 EXPECT_TRUE(value && value->GetAsString(&webgl_status));
254 EXPECT_STREQ(webgl_allowed ? kWebGLStatusAllowed : kWebGLStatusBlocked, 256 EXPECT_STREQ(webgl_allowed ? kWebGLStatusAllowed : kWebGLStatusBlocked,
255 webgl_status.c_str()); 257 webgl_status.c_str());
256 } 258 }
257 }; 259 };
258 260
259 // Test cases where the user accepts the install confirmation dialog. 261 // Test cases where the user accepts the install confirmation dialog.
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 blacklist->UpdateGpuDataManager(); 454 blacklist->UpdateGpuDataManager();
453 GpuFeatureType type = 455 GpuFeatureType type =
454 content::GpuDataManager::GetInstance()->GetGpuFeatureType(); 456 content::GpuDataManager::GetInstance()->GetGpuFeatureType();
455 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_WEBGL); 457 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_WEBGL);
456 458
457 bool webgl_allowed = false; 459 bool webgl_allowed = false;
458 RunTest(webgl_allowed); 460 RunTest(webgl_allowed);
459 } 461 }
460 462
461 } // namespace extensions 463 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_test.cc ('k') | chrome/browser/extensions/extension_management_api_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698