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

Side by Side Diff: chrome/browser/ui/panels/base_panel_browser_test.cc

Issue 322893002: Cleanup: Make ExtensionService::OnExtensionInstalled take a bitmask instead of (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more win compile fixes Created 6 years, 6 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 | Annotate | Revision Log
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/ui/panels/base_panel_browser_test.h" 5 #include "chrome/browser/ui/panels/base_panel_browser_test.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 12 matching lines...) Expand all
23 #include "chrome/browser/ui/panels/test_panel_active_state_observer.h" 23 #include "chrome/browser/ui/panels/test_panel_active_state_observer.h"
24 #include "chrome/browser/ui/panels/test_panel_mouse_watcher.h" 24 #include "chrome/browser/ui/panels/test_panel_mouse_watcher.h"
25 #include "chrome/common/chrome_paths.h" 25 #include "chrome/common/chrome_paths.h"
26 #include "chrome/common/chrome_switches.h" 26 #include "chrome/common/chrome_switches.h"
27 #include "chrome/test/base/interactive_test_utils.h" 27 #include "chrome/test/base/interactive_test_utils.h"
28 #include "chrome/test/base/ui_test_utils.h" 28 #include "chrome/test/base/ui_test_utils.h"
29 #include "content/public/browser/notification_service.h" 29 #include "content/public/browser/notification_service.h"
30 #include "content/public/common/url_constants.h" 30 #include "content/public/common/url_constants.h"
31 #include "content/public/test/web_contents_tester.h" 31 #include "content/public/test/web_contents_tester.h"
32 #include "extensions/browser/extension_prefs.h" 32 #include "extensions/browser/extension_prefs.h"
33 #include "extensions/browser/install_flag.h"
33 #include "extensions/common/manifest_constants.h" 34 #include "extensions/common/manifest_constants.h"
34 #include "sync/api/string_ordinal.h" 35 #include "sync/api/string_ordinal.h"
35 36
36 #if defined(OS_LINUX) 37 #if defined(OS_LINUX)
37 #include "chrome/browser/ui/browser_window.h" 38 #include "chrome/browser/ui/browser_window.h"
38 #include "ui/base/x/x11_util.h" 39 #include "ui/base/x/x11_util.h"
39 #endif 40 #endif
40 41
41 #if defined(OS_MACOSX) 42 #if defined(OS_MACOSX)
42 #include "base/mac/scoped_nsautorelease_pool.h" 43 #include "base/mac/scoped_nsautorelease_pool.h"
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 558
558 scoped_ptr<base::DictionaryValue> input_value(extra_value.DeepCopy()); 559 scoped_ptr<base::DictionaryValue> input_value(extra_value.DeepCopy());
559 input_value->SetString(extensions::manifest_keys::kVersion, "1.0.0.0"); 560 input_value->SetString(extensions::manifest_keys::kVersion, "1.0.0.0");
560 input_value->SetString(extensions::manifest_keys::kName, "Sample Extension"); 561 input_value->SetString(extensions::manifest_keys::kName, "Sample Extension");
561 562
562 std::string error; 563 std::string error;
563 scoped_refptr<Extension> extension = Extension::Create( 564 scoped_refptr<Extension> extension = Extension::Create(
564 full_path, location, *input_value, Extension::NO_FLAGS, &error); 565 full_path, location, *input_value, Extension::NO_FLAGS, &error);
565 EXPECT_TRUE(extension.get()); 566 EXPECT_TRUE(extension.get());
566 EXPECT_STREQ("", error.c_str()); 567 EXPECT_STREQ("", error.c_str());
567 browser()->profile()->GetExtensionService()-> 568 browser()->profile()->GetExtensionService()->OnExtensionInstalled(
568 OnExtensionInstalled(extension.get(), 569 extension.get(),
569 syncer::StringOrdinal(), 570 syncer::StringOrdinal(),
570 false /* no requirement errors */, 571 extensions::kInstallFlagInstallImmediately);
571 extensions::NOT_BLACKLISTED,
572 false /* not ephemeral */,
573 false /* don't wait for idle */);
574 return extension; 572 return extension;
575 } 573 }
576 574
577 void BasePanelBrowserTest::CloseWindowAndWait(Panel* panel) { 575 void BasePanelBrowserTest::CloseWindowAndWait(Panel* panel) {
578 // Closing a panel may involve several async tasks. Need to use 576 // Closing a panel may involve several async tasks. Need to use
579 // message pump and wait for the notification. 577 // message pump and wait for the notification.
580 PanelManager* manager = PanelManager::GetInstance(); 578 PanelManager* manager = PanelManager::GetInstance();
581 int panel_count = manager->num_panels(); 579 int panel_count = manager->num_panels();
582 content::WindowedNotificationObserver signal( 580 content::WindowedNotificationObserver signal(
583 chrome::NOTIFICATION_PANEL_CLOSED, 581 chrome::NOTIFICATION_PANEL_CLOSED,
(...skipping 30 matching lines...) Expand all
614 } 612 }
615 613
616 std::string BasePanelBrowserTest::MakePanelName(int index) { 614 std::string BasePanelBrowserTest::MakePanelName(int index) {
617 std::string panel_name("Panel"); 615 std::string panel_name("Panel");
618 return panel_name + base::IntToString(index); 616 return panel_name + base::IntToString(index);
619 } 617 }
620 618
621 bool BasePanelBrowserTest::WmSupportWindowActivation() { 619 bool BasePanelBrowserTest::WmSupportWindowActivation() {
622 return true; 620 return true;
623 } 621 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698