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

Side by Side Diff: chrome/browser/extensions/api/developer_private/developer_private_apitest.cc

Issue 11428116: First few API implementation of AppsDebuggerPrivate. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Adding test files Created 8 years 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 #include <map>
6
7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/common/chrome_switches.h"
9
10 using extensions::Extension;
11 using extensions::Manifest;
12
13 class DeveloperPrivateApiTest : public ExtensionApiTest {
14 public:
15 virtual void SetUpCommandLine(CommandLine* command_line) {
16 ExtensionApiTest::SetUpCommandLine(command_line);
17 command_line->AppendSwitch(switches::kAppsDebugger);
18 }
19
20 virtual void LoadExtensions() {
21 FilePath basedir = test_data_dir_.AppendASCII("developer");
miket_OOO 2012/12/06 19:31:15 base_dir to be consistent
Gaurav 2012/12/12 02:23:38 Done.
22 LoadNamedExtension(basedir, "hosted_app");
23 }
24
25 protected:
26 void LoadNamedExtension(const FilePath& path,
27 const std::string& name) {
miket_OOO 2012/12/06 19:31:15 wrapping probably not necessary here
Gaurav 2012/12/12 02:23:38 I will be loading more test extensions here. On 20
28 const Extension* extension = LoadExtension(path.AppendASCII(name));
29 ASSERT_TRUE(extension);
30 extension_ids_[name] = extension->id();
31 }
32
33 void InstallNamedExtension(const FilePath& path,
34 const std::string& name,
35 Extension::Location install_source) {
36 const Extension* extension = InstallExtension(path.AppendASCII(name), 1,
37 install_source);
38 ASSERT_TRUE(extension);
39 extension_ids_[name] = extension->id();
40 }
41
42 // Maps installed extension names to their IDs.
43 std::map<std::string, std::string> extension_ids_;
miket_OOO 2012/12/06 19:31:15 If you name this something like "extension_names_t
Gaurav 2012/12/12 02:23:38 Done.
44 };
45
46 IN_PROC_BROWSER_TEST_F(DeveloperPrivateApiTest, Basics) {
47 LoadExtensions();
48
49 FilePath basedir = test_data_dir_.AppendASCII("developer");
50 InstallNamedExtension(basedir, "packaged_app", Extension::INTERNAL);
51
52 InstallNamedExtension(basedir, "simple_extension", Extension::INTERNAL);
53
54 ASSERT_TRUE(RunExtensionSubtest(
55 "developer/test", "basics.html", kFlagLoadAsComponent));
56 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698