| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/browser/extensions/api/top_sites/top_sites_api.h" | 9 #include "chrome/browser/extensions/api/top_sites/top_sites_api.h" |
| 10 #include "chrome/browser/extensions/extension_function_test_utils.h" | 10 #include "chrome/browser/extensions/extension_function_test_utils.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace | 69 } // namespace |
| 70 | 70 |
| 71 IN_PROC_BROWSER_TEST_F(TopSitesExtensionTest, GetTopSites) { | 71 IN_PROC_BROWSER_TEST_F(TopSitesExtensionTest, GetTopSites) { |
| 72 scoped_refptr<TopSitesGetFunction> get_top_sites_function( | 72 scoped_refptr<TopSitesGetFunction> get_top_sites_function( |
| 73 new TopSitesGetFunction()); | 73 new TopSitesGetFunction()); |
| 74 // Without a callback the function will not generate a result. | 74 // Without a callback the function will not generate a result. |
| 75 get_top_sites_function->set_has_callback(true); | 75 get_top_sites_function->set_has_callback(true); |
| 76 | 76 |
| 77 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( | 77 std::unique_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( |
| 78 get_top_sites_function.get(), "[]", browser())); | 78 get_top_sites_function.get(), "[]", browser())); |
| 79 base::ListValue* list; | 79 base::ListValue* list; |
| 80 ASSERT_TRUE(result->GetAsList(&list)); | 80 ASSERT_TRUE(result->GetAsList(&list)); |
| 81 EXPECT_GE(list->GetSize(), top_sites_prepopulated_pages_size()); | 81 EXPECT_GE(list->GetSize(), top_sites_prepopulated_pages_size()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace extensions | 84 } // namespace extensions |
| OLD | NEW |