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

Unified Diff: content/public/test/browser_test_base.h

Issue 468493003: Admixtures in BrowserTestBase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor style fixes Created 6 years, 4 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
« no previous file with comments | « chrome/test/base/in_process_browser_test.cc ('k') | content/public/test/browser_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « chrome/test/base/in_process_browser_test.cc ('k') | content/public/test/browser_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698