diff options
author | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-21 23:30:15 +0000 |
---|---|---|
committer | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-21 23:30:15 +0000 |
commit | 438c97d23785f28465304e1cb521b5125e9ea469 (patch) | |
tree | 5bc5c6ae6c72b9c8567c13a0b32d491b25e81f88 /chrome/browser/extensions/extensions_quota_service_unittest.cc | |
parent | 69e297f187425f2b31db37bfe51af86f28c38275 (diff) | |
download | chromium_src-438c97d23785f28465304e1cb521b5125e9ea469.zip chromium_src-438c97d23785f28465304e1cb521b5125e9ea469.tar.gz chromium_src-438c97d23785f28465304e1cb521b5125e9ea469.tar.bz2 |
Update extension functions to always pass a list of arguments, even when one argument was passed.
BUG=36301
TEST=Updated tests and ran all the existing tests.
Review URL: http://codereview.chromium.org/2137012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47972 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extensions_quota_service_unittest.cc')
-rw-r--r-- | chrome/browser/extensions/extensions_quota_service_unittest.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/browser/extensions/extensions_quota_service_unittest.cc b/chrome/browser/extensions/extensions_quota_service_unittest.cc index 80457eb..72958a9 100644 --- a/chrome/browser/extensions/extensions_quota_service_unittest.cc +++ b/chrome/browser/extensions/extensions_quota_service_unittest.cc @@ -29,11 +29,10 @@ class Mapper : public QuotaLimitHeuristic::BucketMapper { public: Mapper() {} virtual ~Mapper() { STLDeleteValues(&buckets_); } - virtual void GetBucketsForArgs(const Value* args, BucketList* buckets) { - const ListValue* v = static_cast<const ListValue*>(args); - for (size_t i = 0; i < v->GetSize(); i++) { + virtual void GetBucketsForArgs(const ListValue* args, BucketList* buckets) { + for (size_t i = 0; i < args->GetSize(); i++) { int id; - ASSERT_TRUE(v->GetInteger(i, &id)); + ASSERT_TRUE(args->GetInteger(i, &id)); if (buckets_.find(id) == buckets_.end()) buckets_[id] = new Bucket(); buckets->push_back(buckets_[id]); @@ -47,13 +46,13 @@ class Mapper : public QuotaLimitHeuristic::BucketMapper { class MockMapper : public QuotaLimitHeuristic::BucketMapper { public: - virtual void GetBucketsForArgs(const Value* args, BucketList* buckets) {} + virtual void GetBucketsForArgs(const ListValue* args, BucketList* buckets) {} }; class MockFunction : public ExtensionFunction { public: explicit MockFunction(const std::string& name) { set_name(name); } - virtual void SetArgs(const Value* args) {} + virtual void SetArgs(const ListValue* args) {} virtual const std::string GetError() { return std::string(); } virtual const std::string GetResult() { return std::string(); } virtual void Run() {} |