OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2010 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_LIVE_SYNC_LIVE_EXTENSIONS_SYNC_TEST_BASE_H_ | |
6 #define CHROME_TEST_LIVE_SYNC_LIVE_EXTENSIONS_SYNC_TEST_BASE_H_ | |
7 #pragma once | |
8 | |
9 #include <map> | |
10 #include <string> | |
11 | |
12 #include "base/basictypes.h" | |
13 #include "base/compiler_specific.h" | |
14 #include "base/scoped_temp_dir.h" | |
15 #include "base/ref_counted.h" | |
16 #include "chrome/test/live_sync/live_sync_test.h" | |
17 | |
18 class Extension; | |
19 | |
20 class LiveExtensionsSyncTestBase : public LiveSyncTest { | |
21 public: | |
22 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.
| |
23 virtual ~LiveExtensionsSyncTestBase(); | |
24 | |
25 // Like LiveSyncTest::SetupClients(), but also initializes | |
26 // extensions for each profile. | |
27 virtual bool SetupClients() WARN_UNUSED_RESULT; | |
28 | |
29 protected: | |
30 // Creates a new unique theme that lasts for the duration of the | |
31 // test. | |
32 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.
| |
33 | |
34 // Creates a new unique extension that lasts for the duration of the | |
35 // test. | |
36 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.
| |
37 | |
38 // Installs the given extension to the given profile. | |
39 static void InstallExtension( | |
40 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.
| |
41 | |
42 // Installs all pending extensions for the given profile. | |
43 void InstallAllPendingExtensions(Profile* profile); | |
Raghu Simha
2010/11/10 21:42:41
Same comment as above.
| |
44 | |
45 private: | |
46 typedef std::map<std::string, scoped_refptr<Extension> > ExtensionMap; | |
47 | |
48 ScopedTempDir extension_base_dir_; | |
49 int extension_index_; | |
50 ExtensionMap extensions_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(LiveExtensionsSyncTestBase); | |
53 }; | |
54 | |
55 #endif // CHROME_TEST_LIVE_SYNC_LIVE_EXTENSIONS_SYNC_TEST_BASE_H_ | |
OLD | NEW |