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

Side by Side Diff: chrome/test/media_router/media_router_base_browsertest.h

Issue 595663002: Put chromoting isolate targets under chromoting_swarm_tests=1 GYP variable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
(Empty)
1 // Copyright 2015 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 #ifndef CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_BASE_BROWSERTEST_H_
6 #define CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_BASE_BROWSERTEST_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "base/timer/timer.h"
12 #include "chrome/browser/extensions/extension_apitest.h"
13 #include "extensions/browser/process_manager_observer.h"
14
15 namespace media_router {
16
17 class MediaRouter;
18
19 /**
20 * Base class for media router browser test.
21 *
22 * It provides the basic functions for integration and e2e browser tests,
23 * including install unpacked or packed extension at beginning of the test,
24 * uninstall the extension at the end of the test.
25 *
26 * This class accepts two flags to specify the location of MR extension:
27 * 1. "--extension-crx" flag to specify the packed extension location
28 * 2. "--extension-unpacked" flag to specify the unpacked extension location
29 * Only one of them should be passed when run browser tests.
30 */
31 class MediaRouterBaseBrowserTest : public ExtensionBrowserTest,
32 public extensions::ProcessManagerObserver {
33 public:
34 MediaRouterBaseBrowserTest();
35 ~MediaRouterBaseBrowserTest() override;
36
37 // InProcessBrowserTest Overrides
38 void SetUp() override;
39 void TearDown() override;
40
41 protected:
42 // InProcessBrowserTest Overrides
43 void SetUpOnMainThread() override;
44 void TearDownOnMainThread() override;
45
46 void InstallAndEnableMRExtension();
47 void UninstallMRExtension();
48
49 virtual void ParseCommandLine();
50
51 // extensions::ProcessManagerObserver Overrides
52 void OnBackgroundHostCreated(extensions::ExtensionHost* host) override;
53
54 // Wait until get the successful callback or timeout.
55 void Wait(base::TimeDelta timeout,
56 base::TimeDelta interval,
57 const base::Callback<bool(void)>& callback);
58
59 // Wait for a specific time.
60 void Wait(base::TimeDelta timeout);
61
62 bool is_unpacked() const { return !extension_unpacked_.empty(); }
63
64 bool is_extension_host_created() const { return extension_host_created_; }
65
66 // These values are initialized via flags.
67 base::FilePath extension_crx_;
68 base::FilePath extension_unpacked_;
69
70 std::string extension_id_;
71 bool extension_host_created_;
72 };
73
74 } // namespace media_router
75
76 #endif // CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_BASE_BROWSERTEST_H_
OLDNEW
« no previous file with comments | « chrome/test/media_router/e2e_tests.gyp ('k') | chrome/test/media_router/media_router_base_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698