Chromium Code Reviews| Index: chrome/test/live_sync/live_extensions_sync_test_base.h |
| diff --git a/chrome/test/live_sync/live_extensions_sync_test_base.h b/chrome/test/live_sync/live_extensions_sync_test_base.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..52c5b5ff40914c22f316ad9135b499f63b5ef45f |
| --- /dev/null |
| +++ b/chrome/test/live_sync/live_extensions_sync_test_base.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_TEST_LIVE_SYNC_LIVE_EXTENSIONS_SYNC_TEST_BASE_H_ |
| +#define CHROME_TEST_LIVE_SYNC_LIVE_EXTENSIONS_SYNC_TEST_BASE_H_ |
| +#pragma once |
| + |
| +#include <map> |
| +#include <string> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/compiler_specific.h" |
| +#include "base/scoped_temp_dir.h" |
| +#include "base/ref_counted.h" |
| +#include "chrome/test/live_sync/live_sync_test.h" |
| + |
| +class Extension; |
| + |
| +class LiveExtensionsSyncTestBase : public LiveSyncTest { |
| + public: |
| + explicit LiveExtensionsSyncTestBase(TestType test_type); |
|
Raghu Simha
2010/11/10 21:42:41
Perhaps this should be a private constructor? Righ
akalin
2010/11/12 01:20:44
Done.
|
| + virtual ~LiveExtensionsSyncTestBase(); |
| + |
| + // Like LiveSyncTest::SetupClients(), but also initializes |
| + // extensions for each profile. |
| + virtual bool SetupClients() WARN_UNUSED_RESULT; |
| + |
| + protected: |
| + // Creates a new unique theme that lasts for the duration of the |
| + // test. |
| + scoped_refptr<Extension> MakeTheme() WARN_UNUSED_RESULT; |
|
Raghu Simha
2010/11/10 21:42:41
I think it'd be better to create a unique theme /
akalin
2010/11/12 01:20:44
Done.
|
| + |
| + // Creates a new unique extension that lasts for the duration of the |
| + // test. |
| + scoped_refptr<Extension> MakeExtension() WARN_UNUSED_RESULT; |
|
Raghu Simha
2010/11/10 21:42:41
Same comment as above.
akalin
2010/11/12 01:20:44
Done.
|
| + |
| + // Installs the given extension to the given profile. |
| + static void InstallExtension( |
| + Profile* profile, scoped_refptr<Extension> extension); |
|
Raghu Simha
2010/11/10 21:42:41
Tests will be a lot easier to write if you take th
akalin
2010/11/12 01:20:44
Given that I need to treat the verifier() separate
Raghu Simha
2010/11/12 01:40:50
You're right. SGTM.
|
| + |
| + // Installs all pending extensions for the given profile. |
| + void InstallAllPendingExtensions(Profile* profile); |
|
Raghu Simha
2010/11/10 21:42:41
Same comment as above.
|
| + |
| + private: |
| + typedef std::map<std::string, scoped_refptr<Extension> > ExtensionMap; |
| + |
| + ScopedTempDir extension_base_dir_; |
| + int extension_index_; |
| + ExtensionMap extensions_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(LiveExtensionsSyncTestBase); |
| +}; |
| + |
| +#endif // CHROME_TEST_LIVE_SYNC_LIVE_EXTENSIONS_SYNC_TEST_BASE_H_ |