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

Side by Side Diff: chrome/browser/extensions/extension_tabs_test.cc

Issue 10375021: Move Extension into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Take 6 Created 8 years, 7 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 "chrome/browser/extensions/extension_tabs_module.h" 5 #include "chrome/browser/extensions/extension_tabs_module.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 EXPECT_TRUE(result_window->GetList(keys::kTabsKey, &tabs)); 240 EXPECT_TRUE(result_window->GetList(keys::kTabsKey, &tabs));
241 } 241 }
242 // The returned ids should contain all the current browser instance ids. 242 // The returned ids should contain all the current browser instance ids.
243 EXPECT_EQ(window_ids, result_ids); 243 EXPECT_EQ(window_ids, result_ids);
244 } 244 }
245 245
246 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, UpdateNoPermissions) { 246 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, UpdateNoPermissions) {
247 // The test empty extension has no permissions, therefore it should not get 247 // The test empty extension has no permissions, therefore it should not get
248 // tab data in the function result. 248 // tab data in the function result.
249 scoped_refptr<UpdateTabFunction> update_tab_function(new UpdateTabFunction()); 249 scoped_refptr<UpdateTabFunction> update_tab_function(new UpdateTabFunction());
250 scoped_refptr<Extension> empty_extension(utils::CreateEmptyExtension()); 250 scoped_refptr<extensions::Extension> empty_extension(
251 utils::CreateEmptyExtension());
251 update_tab_function->set_extension(empty_extension.get()); 252 update_tab_function->set_extension(empty_extension.get());
252 // Without a callback the function will not generate a result. 253 // Without a callback the function will not generate a result.
253 update_tab_function->set_has_callback(true); 254 update_tab_function->set_has_callback(true);
254 255
255 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnResult( 256 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnResult(
256 update_tab_function.get(), 257 update_tab_function.get(),
257 "[null, {\"url\": \"neutrinos\"}]", 258 "[null, {\"url\": \"neutrinos\"}]",
258 browser())); 259 browser()));
259 EXPECT_EQ(base::Value::TYPE_NULL, result->GetType()); 260 EXPECT_EQ(base::Value::TYPE_NULL, result->GetType());
260 } 261 }
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 530
530 static const char kArgsMaximizedWithBounds[] = 531 static const char kArgsMaximizedWithBounds[] =
531 "[%u, {\"state\": \"maximized\", \"width\": 500}]"; 532 "[%u, {\"state\": \"maximized\", \"width\": 500}]";
532 EXPECT_TRUE(MatchPattern( 533 EXPECT_TRUE(MatchPattern(
533 utils::RunFunctionAndReturnError( 534 utils::RunFunctionAndReturnError(
534 new UpdateWindowFunction(), 535 new UpdateWindowFunction(),
535 base::StringPrintf(kArgsMaximizedWithBounds, window_id), 536 base::StringPrintf(kArgsMaximizedWithBounds, window_id),
536 browser()), 537 browser()),
537 keys::kInvalidWindowStateError)); 538 keys::kInvalidWindowStateError));
538 } 539 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module.h ('k') | chrome/browser/extensions/extension_toolbar_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698