Chromium Code Reviews| Index: content/public/test/browser_test_base.h |
| diff --git a/content/public/test/browser_test_base.h b/content/public/test/browser_test_base.h |
| index 1514c65062ee50ec668b1c6f37e472e98e7c7f10..061896dbc12a06668c96f7d9290ecebb5cfa59f2 100644 |
| --- a/content/public/test/browser_test_base.h |
| +++ b/content/public/test/browser_test_base.h |
| @@ -7,6 +7,7 @@ |
| #include "base/callback.h" |
| #include "base/compiler_specific.h" |
| +#include "base/memory/scoped_vector.h" |
| #include "base/threading/thread.h" |
| #include "net/test/spawned_test_server/spawned_test_server.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| @@ -28,6 +29,21 @@ namespace content { |
| class BrowserTestBase : public testing::Test { |
| public: |
| + // Class that can be used to add some features not related directly |
| + // to the testing process and do set ups needed for them in proper time. |
| + // To do this you need to derive Admixture, implement |
| + // all the methods you need there and (if needed) reload set ups, if you need |
| + // to set up something because of this API. |
| + class Admixture { |
| + public: |
| + Admixture() {} |
| + virtual ~Admixture() {} |
| + virtual void SetUpCommandLine(base::CommandLine* command_line) {} |
| + virtual void SetUpOnMainThread() {} |
| + virtual void SetUpInProcessBrowserTestFixture() = 0; |
|
dzhioev (left Google)
2014/08/15 14:37:14
Add a default implementation for this method.
Lisa Ignatyeva
2014/08/15 16:12:37
Done.
|
| + virtual bool SetUpUserDataDirectory(); |
|
dzhioev (left Google)
2014/08/15 14:37:14
I doubt this method will be really needed in admix
Lisa Ignatyeva
2014/08/15 16:12:37
Done.
|
| + }; |
|
dzhioev (left Google)
2014/08/15 14:37:14
We need TearDown* methods here as well.
Lisa Ignatyeva
2014/08/15 16:12:37
Done.
|
| + |
| BrowserTestBase(); |
| virtual ~BrowserTestBase(); |
| @@ -130,6 +146,17 @@ class BrowserTestBase : public testing::Test { |
| // Returns true if the test will be using GL acceleration via OSMesa. |
| bool UsingOSMesa() const; |
| + // Adds |admixture| as an admixture for this test. |
| + void AddAdmixture(Admixture* admixture); |
|
dzhioev (left Google)
2014/08/15 14:37:14
Please add comment that this method should only be
Lisa Ignatyeva
2014/08/15 16:12:37
Done.
|
| + |
| + // Returns admixtures for this test. |
| + ScopedVector<Admixture> GetAdmixtures(); |
|
dzhioev (left Google)
2014/08/15 14:37:14
It's a bad idea to pass ownership to caller. You c
Lisa Ignatyeva
2014/08/15 16:12:37
Done.
|
| + |
| + // Passes admixtures ownership back. |
| + void ReturnAdmixtures(ScopedVector<BrowserTestBase::Admixture> arg); |
| + |
| + // Holds admixtures for this test. |
| + ScopedVector<Admixture> admixtures_; |
|
dzhioev (left Google)
2014/08/15 14:37:14
Put this declaration into private section.
Lisa Ignatyeva
2014/08/15 16:12:37
Done.
|
| private: |
| void ProxyRunTestOnMainThreadLoop(); |