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

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

Issue 5730004: Rename ExtensionsService to ExtensionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo Created 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
11 #include "chrome/browser/browser_window.h" 11 #include "chrome/browser/browser_window.h"
12 #include "chrome/browser/extensions/browser_action_test_util.h" 12 #include "chrome/browser/extensions/browser_action_test_util.h"
13 #include "chrome/browser/extensions/extension_apitest.h" 13 #include "chrome/browser/extensions/extension_apitest.h"
14 #include "chrome/browser/extensions/extension_browser_event_router.h" 14 #include "chrome/browser/extensions/extension_browser_event_router.h"
15 #include "chrome/browser/extensions/extension_tabs_module.h" 15 #include "chrome/browser/extensions/extension_tabs_module.h"
16 #include "chrome/browser/extensions/extensions_service.h" 16 #include "chrome/browser/extensions/extension_service.h"
17 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/tab_contents/tab_contents.h" 18 #include "chrome/browser/tab_contents/tab_contents.h"
19 #include "chrome/browser/ui/browser.h" 19 #include "chrome/browser/ui/browser.h"
20 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.h"
21 #include "chrome/common/extensions/extension_action.h" 21 #include "chrome/common/extensions/extension_action.h"
22 #include "chrome/common/url_constants.h" 22 #include "chrome/common/url_constants.h"
23 #include "chrome/test/ui_test_utils.h" 23 #include "chrome/test/ui_test_utils.h"
24 #include "gfx/rect.h" 24 #include "gfx/rect.h"
25 #include "gfx/size.h" 25 #include "gfx/size.h"
26 26
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 // default. 279 // default.
280 Profile* incognito_profile = browser()->profile()->GetOffTheRecordProfile(); 280 Profile* incognito_profile = browser()->profile()->GetOffTheRecordProfile();
281 Browser* incognito_browser = Browser::Create(incognito_profile); 281 Browser* incognito_browser = Browser::Create(incognito_profile);
282 282
283 ASSERT_EQ(0, 283 ASSERT_EQ(0,
284 BrowserActionTestUtil(incognito_browser).NumberOfBrowserActions()); 284 BrowserActionTestUtil(incognito_browser).NumberOfBrowserActions());
285 285
286 // Now enable the extension in incognito mode, and test that the browser 286 // Now enable the extension in incognito mode, and test that the browser
287 // action shows up. Note that we don't update the existing window at the 287 // action shows up. Note that we don't update the existing window at the
288 // moment, so we just create a new one. 288 // moment, so we just create a new one.
289 browser()->profile()->GetExtensionsService()->extension_prefs()-> 289 browser()->profile()->GetExtensionService()->extension_prefs()->
290 SetIsIncognitoEnabled(extension->id(), true); 290 SetIsIncognitoEnabled(extension->id(), true);
291 291
292 incognito_browser->CloseWindow(); 292 incognito_browser->CloseWindow();
293 incognito_browser = Browser::Create(incognito_profile); 293 incognito_browser = Browser::Create(incognito_profile);
294 ASSERT_EQ(1, 294 ASSERT_EQ(1,
295 BrowserActionTestUtil(incognito_browser).NumberOfBrowserActions()); 295 BrowserActionTestUtil(incognito_browser).NumberOfBrowserActions());
296 296
297 // TODO(mpcomplete): simulate a click and have it do the right thing in 297 // TODO(mpcomplete): simulate a click and have it do the right thing in
298 // incognito. 298 // incognito.
299 } 299 }
300 300
301 IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, IncognitoDragging) { 301 IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, IncognitoDragging) {
302 ExtensionsService* service = browser()->profile()->GetExtensionsService(); 302 ExtensionService* service = browser()->profile()->GetExtensionService();
303 303
304 // The tooltips for each respective browser action. 304 // The tooltips for each respective browser action.
305 const char kTooltipA[] = "Make this page red"; 305 const char kTooltipA[] = "Make this page red";
306 const char kTooltipB[] = "grow"; 306 const char kTooltipB[] = "grow";
307 const char kTooltipC[] = "Test setPopup()"; 307 const char kTooltipC[] = "Test setPopup()";
308 308
309 const size_t size_before = service->extensions()->size(); 309 const size_t size_before = service->extensions()->size();
310 310
311 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( 311 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
312 "browser_action/basics"))); 312 "browser_action/basics")));
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 service->toolbar_model()->MoveBrowserAction( 362 service->toolbar_model()->MoveBrowserAction(
363 service->extensions()->at(size_before + 1), 1); 363 service->extensions()->at(size_before + 1), 1);
364 364
365 EXPECT_EQ(kTooltipC, GetBrowserActionsBar().GetTooltip(0)); 365 EXPECT_EQ(kTooltipC, GetBrowserActionsBar().GetTooltip(0));
366 EXPECT_EQ(kTooltipB, GetBrowserActionsBar().GetTooltip(1)); 366 EXPECT_EQ(kTooltipB, GetBrowserActionsBar().GetTooltip(1));
367 EXPECT_EQ(kTooltipA, GetBrowserActionsBar().GetTooltip(2)); 367 EXPECT_EQ(kTooltipA, GetBrowserActionsBar().GetTooltip(2));
368 368
369 EXPECT_EQ(kTooltipC, incognito_bar.GetTooltip(0)); 369 EXPECT_EQ(kTooltipC, incognito_bar.GetTooltip(0));
370 EXPECT_EQ(kTooltipA, incognito_bar.GetTooltip(1)); 370 EXPECT_EQ(kTooltipA, incognito_bar.GetTooltip(1));
371 } 371 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/all_urls_apitest.cc ('k') | chrome/browser/extensions/content_script_extension_process_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698