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

Side by Side Diff: chrome/browser/extensions/api/top_sites/top_sites_apitest.cc

Issue 11522007: Move TopSites api from c/b/history to c/b/e/api (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_ungoop_history
Patch Set: Created 8 years 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/api/top_sites/top_sites_api.h"
7 #include "chrome/browser/extensions/extension_function_test_utils.h" 8 #include "chrome/browser/extensions/extension_function_test_utils.h"
8 #include "chrome/browser/history/top_sites.h" 9 #include "chrome/browser/history/top_sites.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"
11 #include "chrome/browser/ui/browser.h" 11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/test/base/in_process_browser_test.h" 12 #include "chrome/test/base/in_process_browser_test.h"
13 13
14 namespace utils = extension_function_test_utils; 14 namespace utils = extension_function_test_utils;
15 15
16 namespace extensions {
17
16 namespace { 18 namespace {
17 19
18 class TopSitesExtensionTest : public InProcessBrowserTest { 20 class TopSitesExtensionTest : public InProcessBrowserTest {
19 public: 21 public:
20 TopSitesExtensionTest() : top_sites_inited_(false), waiting_(false) { 22 TopSitesExtensionTest() : top_sites_inited_(false), waiting_(false) {
21 } 23 }
22 24
23 void SetUpOnMainThread() { 25 void SetUpOnMainThread() {
24 history::TopSites* top_sites = browser()->profile()->GetTopSites(); 26 history::TopSites* top_sites = browser()->profile()->GetTopSites();
25 27
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 new GetTopSitesFunction()); 59 new GetTopSitesFunction());
58 // Without a callback the function will not generate a result. 60 // Without a callback the function will not generate a result.
59 get_top_sites_function->set_has_callback(true); 61 get_top_sites_function->set_has_callback(true);
60 62
61 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( 63 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult(
62 get_top_sites_function.get(), "[]", browser())); 64 get_top_sites_function.get(), "[]", browser()));
63 base::ListValue* list; 65 base::ListValue* list;
64 ASSERT_TRUE(result->GetAsList(&list)); 66 ASSERT_TRUE(result->GetAsList(&list));
65 EXPECT_GE(list->GetSize(), arraysize(history::kPrepopulatedPages)); 67 EXPECT_GE(list->GetSize(), arraysize(history::kPrepopulatedPages));
66 } 68 }
69
70 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/top_sites/top_sites_api.cc ('k') | chrome/browser/extensions/extension_function_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698