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

Side by Side Diff: chrome/browser/chromeos/extensions/wallpaper_manager_browsertest.cc

Issue 587843002: Test wallpaper picker app could launch in dev and stable channel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/files/file_path.h"
6 #include "base/path_service.h"
7 #include "chrome/browser/apps/app_browsertest_util.h"
8 #include "chrome/browser/extensions/component_loader.h"
9 #include "chrome/browser/extensions/extension_service.h"
10 #include "extensions/browser/extension_registry.h"
11 #include "extensions/test/extension_test_message_listener.h"
12 #include "grit/browser_resources.h"
13
14 using extensions::Extension;
15 using extensions::ExtensionRegistry;
16
17 namespace {
18 const char* kWallpaperManagerExtensionID = "obklkkbkpaoaejdabbfldmcfplpdgolj";
19 } // namespace
20
21 class WallpaperManagerBrowserTest : public extensions::PlatformAppBrowserTest {
22 public:
23 WallpaperManagerBrowserTest();
24 virtual ~WallpaperManagerBrowserTest();
25
26 protected:
27 void VerifyWallpaperManagerLoaded();
28
29 private:
30 void LoadAndLaunchWallpaperManager();
31 };
32
33 WallpaperManagerBrowserTest::WallpaperManagerBrowserTest() {
34 }
35
36 WallpaperManagerBrowserTest::~WallpaperManagerBrowserTest() {
37 }
38
39 void WallpaperManagerBrowserTest::LoadAndLaunchWallpaperManager() {
40 extension_service()->component_loader()->Add(
41 IDR_WALLPAPERMANAGER_MANIFEST,
42 base::FilePath(FILE_PATH_LITERAL("chromeos/wallpaper_manager")));
43 const Extension* wallpaper_app =
44 ExtensionRegistry::Get(profile())->GetExtensionById(
45 kWallpaperManagerExtensionID, ExtensionRegistry::EVERYTHING);
46 LaunchPlatformApp(wallpaper_app);
47 }
48
49 void WallpaperManagerBrowserTest::VerifyWallpaperManagerLoaded() {
50 ExtensionTestMessageListener window_created_listener(
51 "wallpaper-window-created", false);
52 ExtensionTestMessageListener launched_listener("launched", false);
53 LoadAndLaunchWallpaperManager();
54 EXPECT_TRUE(window_created_listener.WaitUntilSatisfied())
55 << "Wallpaper picker window was not created.";
56 EXPECT_TRUE(launched_listener.WaitUntilSatisfied())
57 << "Wallpaper picker was not loaded.";
58 }
59
60 // Test for crbug.com/410550.
61 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, DevLaunchApp) {
62 VerifyWallpaperManagerLoaded();
63 }
64
65 // Test for crbug.com/410550. Wallpaper picker should be able to create
66 // alpha enabled window successfully.
67 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, StableLaunchApp) {
68 extensions::ScopedCurrentChannel channel(chrome::VersionInfo::CHANNEL_STABLE);
69 VerifyWallpaperManagerLoaded();
70 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698