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

Side by Side Diff: chrome/browser/extensions/api/extension_action/page_as_browser_action_apitest.cc

Issue 10704023: Moved ExtensionPrefs and related into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest-er master merged in 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/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/extensions/browser_action_test_util.h" 6 #include "chrome/browser/extensions/browser_action_test_util.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_browser_event_router.h" 8 #include "chrome/browser/extensions/extension_browser_event_router.h"
9 #include "chrome/browser/extensions/extension_prefs.h" 9 #include "chrome/browser/extensions/extension_prefs.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 ASSERT_TRUE(RunExtensionTest("page_action/basics")) << message_; 50 ASSERT_TRUE(RunExtensionTest("page_action/basics")) << message_;
51 const Extension* extension = GetSingleLoadedExtension(); 51 const Extension* extension = GetSingleLoadedExtension();
52 ASSERT_TRUE(extension) << message_; 52 ASSERT_TRUE(extension) << message_;
53 53
54 // The extension declares a page action, but it should have gotten a browser 54 // The extension declares a page action, but it should have gotten a browser
55 // action instead. 55 // action instead.
56 ASSERT_TRUE(extension->browser_action()); 56 ASSERT_TRUE(extension->browser_action());
57 ASSERT_FALSE(extension->page_action()); 57 ASSERT_FALSE(extension->page_action());
58 58
59 // With the "action box" there won't be browser actions unless they're pinned. 59 // With the "action box" there won't be browser actions unless they're pinned.
60 ExtensionPrefs* prefs = 60 extensions::ExtensionPrefs* prefs =
61 browser()->profile()->GetExtensionService()->extension_prefs(); 61 browser()->profile()->GetExtensionService()->extension_prefs();
62 prefs->SetBrowserActionVisibility(extension, true); 62 prefs->SetBrowserActionVisibility(extension, true);
63 63
64 // Test that there is a browser action in the toolbar. 64 // Test that there is a browser action in the toolbar.
65 ASSERT_EQ(1, GetBrowserActionsBar().NumberOfBrowserActions()); 65 ASSERT_EQ(1, GetBrowserActionsBar().NumberOfBrowserActions());
66 66
67 { 67 {
68 // Tell the extension to update the page action state. 68 // Tell the extension to update the page action state.
69 ResultCatcher catcher; 69 ResultCatcher catcher;
70 ui_test_utils::NavigateToURL(browser(), 70 ui_test_utils::NavigateToURL(browser(),
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 const Extension* extension = GetSingleLoadedExtension(); 180 const Extension* extension = GetSingleLoadedExtension();
181 ASSERT_TRUE(extension) << message_; 181 ASSERT_TRUE(extension) << message_;
182 182
183 ResultCatcher catcher; 183 ResultCatcher catcher;
184 ui_test_utils::NavigateToURL(browser(), 184 ui_test_utils::NavigateToURL(browser(),
185 GURL(extension->GetResourceURL("update.html"))); 185 GURL(extension->GetResourceURL("update.html")));
186 ASSERT_TRUE(catcher.GetNextResult()); 186 ASSERT_TRUE(catcher.GetNextResult());
187 } 187 }
188 188
189 } 189 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698