OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/test_extension_environment.h" | 5 #include "chrome/browser/extensions/test_extension_environment.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 scoped_ptr<base::DictionaryValue> manifest = DictionaryBuilder() | 34 scoped_ptr<base::DictionaryValue> manifest = DictionaryBuilder() |
35 .Set("name", "Extension") | 35 .Set("name", "Extension") |
36 .Set("version", "1.0") | 36 .Set("version", "1.0") |
37 .Set("manifest_version", 2) | 37 .Set("manifest_version", 2) |
38 .Build(); | 38 .Build(); |
39 const base::DictionaryValue* manifest_extra_dict; | 39 const base::DictionaryValue* manifest_extra_dict; |
40 if (manifest_extra.GetAsDictionary(&manifest_extra_dict)) { | 40 if (manifest_extra.GetAsDictionary(&manifest_extra_dict)) { |
41 manifest->MergeDictionary(manifest_extra_dict); | 41 manifest->MergeDictionary(manifest_extra_dict); |
42 } else { | 42 } else { |
43 std::string manifest_json; | 43 std::string manifest_json; |
44 base::JSONWriter::Write(&manifest_extra, &manifest_json); | 44 base::JSONWriter::Write(manifest_extra, &manifest_json); |
45 ADD_FAILURE() << "Expected dictionary; got \"" << manifest_json << "\""; | 45 ADD_FAILURE() << "Expected dictionary; got \"" << manifest_json << "\""; |
46 } | 46 } |
47 return manifest; | 47 return manifest; |
48 } | 48 } |
49 | 49 |
50 } // namespace | 50 } // namespace |
51 | 51 |
52 TestExtensionEnvironment::TestExtensionEnvironment() | 52 TestExtensionEnvironment::TestExtensionEnvironment() |
53 : profile_(new TestingProfile), | 53 : profile_(new TestingProfile), |
54 extension_service_(NULL), | 54 extension_service_(NULL), |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 scoped_ptr<content::WebContents> TestExtensionEnvironment::MakeTab() const { | 112 scoped_ptr<content::WebContents> TestExtensionEnvironment::MakeTab() const { |
113 scoped_ptr<content::WebContents> contents( | 113 scoped_ptr<content::WebContents> contents( |
114 content::WebContentsTester::CreateTestWebContents(profile(), NULL)); | 114 content::WebContentsTester::CreateTestWebContents(profile(), NULL)); |
115 // Create a tab id. | 115 // Create a tab id. |
116 SessionTabHelper::CreateForWebContents(contents.get()); | 116 SessionTabHelper::CreateForWebContents(contents.get()); |
117 return contents.Pass(); | 117 return contents.Pass(); |
118 } | 118 } |
119 | 119 |
120 } // namespace extensions | 120 } // namespace extensions |
OLD | NEW |