| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_BASE_BROWSERTEST_H_ | 5 #ifndef CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_BASE_BROWSERTEST_H_ |
| 6 #define CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_BASE_BROWSERTEST_H_ | 6 #define CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_BASE_BROWSERTEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 // InProcessBrowserTest Overrides | 37 // InProcessBrowserTest Overrides |
| 38 void SetUp() override; | 38 void SetUp() override; |
| 39 void TearDown() override; | 39 void TearDown() override; |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 // InProcessBrowserTest Overrides | 42 // InProcessBrowserTest Overrides |
| 43 void SetUpOnMainThread() override; | 43 void SetUpOnMainThread() override; |
| 44 void TearDownOnMainThread() override; | 44 void TearDownOnMainThread() override; |
| 45 | 45 |
| 46 void InstallAndEnableMRExtension(); | 46 virtual void InstallAndEnableMRExtension(); |
| 47 void UninstallMRExtension(); | 47 virtual void UninstallMRExtension(); |
| 48 | 48 |
| 49 virtual void ParseCommandLine(); | 49 virtual void ParseCommandLine(); |
| 50 | 50 |
| 51 // extensions::ProcessManagerObserver Overrides | 51 // extensions::ProcessManagerObserver Overrides |
| 52 void OnBackgroundHostCreated(extensions::ExtensionHost* host) override; | 52 void OnBackgroundHostCreated(extensions::ExtensionHost* host) override; |
| 53 | 53 |
| 54 // Wait until get the successful callback or timeout. | 54 // Wait until get the successful callback or timeout. |
| 55 // Returns true if the condition is satisfied before the timeout. | 55 // Returns true if the condition is satisfied before the timeout. |
| 56 // TODO(leilei): Replace this method with WaitableEvent class. | 56 // TODO(leilei): Replace this method with WaitableEvent class. |
| 57 bool ConditionalWait(base::TimeDelta timeout, | 57 bool ConditionalWait(base::TimeDelta timeout, |
| 58 base::TimeDelta interval, | 58 base::TimeDelta interval, |
| 59 const base::Callback<bool(void)>& callback); | 59 const base::Callback<bool(void)>& callback); |
| 60 | 60 |
| 61 // Wait for a specific time. | 61 // Wait for a specific time. |
| 62 void Wait(base::TimeDelta timeout); | 62 void Wait(base::TimeDelta timeout); |
| 63 | 63 |
| 64 bool is_unpacked() const { return !extension_unpacked_.empty(); } | |
| 65 | |
| 66 bool is_extension_host_created() const { return extension_host_created_; } | 64 bool is_extension_host_created() const { return extension_host_created_; } |
| 67 | 65 |
| 68 bool is_incognito() { return profile()->IsOffTheRecord(); } | 66 bool is_incognito() { return profile()->IsOffTheRecord(); } |
| 69 | 67 |
| 70 // These values are initialized via flags. | 68 // Returns the superclass' browser(). Marked virtual so that it can be |
| 71 base::FilePath extension_crx_; | 69 // overridden by MediaRouterIntegrationIncognitoBrowserTest. |
| 70 virtual Browser* browser(); |
| 71 |
| 72 // |extension_unpacked_| is initialized via a flag. |
| 72 base::FilePath extension_unpacked_; | 73 base::FilePath extension_unpacked_; |
| 73 | 74 |
| 74 base::WaitableEvent extension_load_event_; | 75 base::WaitableEvent extension_load_event_; |
| 75 std::string extension_id_; | 76 std::string extension_id_; |
| 76 bool extension_host_created_; | 77 bool extension_host_created_; |
| 77 | 78 |
| 78 private: | 79 private: |
| 79 DISALLOW_COPY_AND_ASSIGN(MediaRouterBaseBrowserTest); | 80 DISALLOW_COPY_AND_ASSIGN(MediaRouterBaseBrowserTest); |
| 80 }; | 81 }; |
| 81 | 82 |
| 82 } // namespace media_router | 83 } // namespace media_router |
| 83 | 84 |
| 84 #endif // CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_BASE_BROWSERTEST_H_ | 85 #endif // CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_BASE_BROWSERTEST_H_ |
| OLD | NEW |