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

Side by Side Diff: chrome/browser/history/top_sites_extension_test.cc

Issue 10694106: Added support for multiple parameters to Extension API callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Synced. Created 8 years, 5 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 "base/values.h" 5 #include "base/values.h"
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 #include "chrome/browser/extensions/extension_function_test_utils.h" 7 #include "chrome/browser/extensions/extension_function_test_utils.h"
8 #include "chrome/browser/history/top_sites.h" 8 #include "chrome/browser/history/top_sites.h"
9 #include "chrome/browser/history/top_sites_extension_api.h" 9 #include "chrome/browser/history/top_sites_extension_api.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 }; 53 };
54 54
55 } // namespace 55 } // namespace
56 56
57 IN_PROC_BROWSER_TEST_F(TopSitesExtensionTest, GetTopSites) { 57 IN_PROC_BROWSER_TEST_F(TopSitesExtensionTest, GetTopSites) {
58 scoped_refptr<GetTopSitesFunction> get_top_sites_function( 58 scoped_refptr<GetTopSitesFunction> get_top_sites_function(
59 new GetTopSitesFunction()); 59 new GetTopSitesFunction());
60 // Without a callback the function will not generate a result. 60 // Without a callback the function will not generate a result.
61 get_top_sites_function->set_has_callback(true); 61 get_top_sites_function->set_has_callback(true);
62 62
63 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnResult( 63 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult(
64 get_top_sites_function.get(), "[]", browser())); 64 get_top_sites_function.get(), "[]", browser()));
65 base::ListValue* list; 65 base::ListValue* list;
66 ASSERT_TRUE(result->GetAsList(&list)); 66 ASSERT_TRUE(result->GetAsList(&list));
67 EXPECT_GE(list->GetSize(), arraysize(history::kPrepopulatedPages)); 67 EXPECT_GE(list->GetSize(), arraysize(history::kPrepopulatedPages));
68 } 68 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698