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

Unified Diff: chrome/browser/ui/panels/base_panel_browser_test.cc

Issue 10987037: Add tests for panel app icon functionaility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix builds Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/panels/base_panel_browser_test.cc
diff --git a/chrome/browser/ui/panels/base_panel_browser_test.cc b/chrome/browser/ui/panels/base_panel_browser_test.cc
index c39c8b2be26eebf7329446a109ae71aa598d1275..a4bd6a67616698c5734e76f6330c02493c5c0f79 100644
--- a/chrome/browser/ui/panels/base_panel_browser_test.cc
+++ b/chrome/browser/ui/panels/base_panel_browser_test.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/json/json_file_value_serializer.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop.h"
#include "base/path_service.h"
@@ -262,6 +263,16 @@ void BasePanelBrowserTest::WaitForWindowSizeAvailable(Panel* panel) {
EXPECT_TRUE(panel_testing->IsWindowSizeKnown());
}
+void BasePanelBrowserTest::WaitForAppIconAvailable(Panel* panel) {
+ content::WindowedNotificationObserver signal(
+ chrome::NOTIFICATION_PANEL_ICON_KNOWN,
+ content::Source<Panel>(panel));
+ if (!panel->app_icon().IsEmpty())
+ return;
+ signal.Wait();
+ EXPECT_FALSE(panel->app_icon().IsEmpty());
+}
+
void BasePanelBrowserTest::WaitForBoundsAnimationFinished(Panel* panel) {
scoped_ptr<NativePanelTesting> panel_testing(
CreateNativePanelTesting(panel));
@@ -424,6 +435,32 @@ scoped_refptr<Extension> BasePanelBrowserTest::CreateExtension(
return extension;
}
+scoped_refptr<extensions::Extension>
+BasePanelBrowserTest::LoadExtensionFromManifest(
jennb 2012/10/02 17:51:08 This logic makes assumptions about extension imple
jianli 2012/10/02 21:37:26 Moved it out to the new file and changed it to use
+ const FilePath::StringType& manifest_file) {
+ FilePath manifest_path;
+ PathService::Get(chrome::DIR_TEST_DATA, &manifest_path);
+ manifest_path = manifest_path.Append(kTestDir);
+ manifest_path = manifest_path.Append(manifest_file);
+
+ JSONFileValueSerializer serializer(manifest_path);
+ scoped_ptr<DictionaryValue> manifest(
+ static_cast<DictionaryValue*>(serializer.Deserialize(NULL, NULL)));
+ EXPECT_TRUE(manifest.get() != NULL);
+
+ std::string error;
+ scoped_refptr<extensions::Extension> extension(Extension::Create(
+ manifest_path.DirName(), Extension::INVALID, *manifest.get(),
+ Extension::NO_FLAGS, &error));
+ EXPECT_TRUE(extension.get());
+ EXPECT_STREQ("", error.c_str());
+ browser()->profile()->GetExtensionService()->
+ OnExtensionInstalled(extension.get(), false /* not from webstore */,
+ syncer::StringOrdinal(),
+ false /* no requirement errors */);
+ return extension;
+}
+
void BasePanelBrowserTest::SetTestingAreas(const gfx::Rect& primary_screen_area,
const gfx::Rect& work_area) {
DCHECK(primary_screen_area.Contains(work_area));

Powered by Google App Engine
This is Rietveld 408576698