| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 if (manifest_extra.GetAsDictionary(&manifest_extra_dict)) { | 66 if (manifest_extra.GetAsDictionary(&manifest_extra_dict)) { |
| 67 manifest->MergeDictionary(manifest_extra_dict); | 67 manifest->MergeDictionary(manifest_extra_dict); |
| 68 } else { | 68 } else { |
| 69 std::string manifest_json; | 69 std::string manifest_json; |
| 70 base::JSONWriter::Write(&manifest_extra, &manifest_json); | 70 base::JSONWriter::Write(&manifest_extra, &manifest_json); |
| 71 ADD_FAILURE() << "Expected dictionary; got \"" << manifest_json << "\""; | 71 ADD_FAILURE() << "Expected dictionary; got \"" << manifest_json << "\""; |
| 72 } | 72 } |
| 73 | 73 |
| 74 scoped_refptr<Extension> result = | 74 scoped_refptr<Extension> result = |
| 75 ExtensionBuilder().SetManifest(manifest.Pass()).Build(); | 75 ExtensionBuilder().SetManifest(manifest.Pass()).Build(); |
| 76 GetExtensionService()->AddExtension(result); | 76 GetExtensionService()->AddExtension(result.get()); |
| 77 return result.get(); | 77 return result.get(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 scoped_ptr<content::WebContents> TestExtensionEnvironment::MakeTab() const { | 80 scoped_ptr<content::WebContents> TestExtensionEnvironment::MakeTab() const { |
| 81 scoped_ptr<content::WebContents> contents( | 81 scoped_ptr<content::WebContents> contents( |
| 82 content::WebContentsTester::CreateTestWebContents(profile(), NULL)); | 82 content::WebContentsTester::CreateTestWebContents(profile(), NULL)); |
| 83 // Create a tab id. | 83 // Create a tab id. |
| 84 SessionTabHelper::CreateForWebContents(contents.get()); | 84 SessionTabHelper::CreateForWebContents(contents.get()); |
| 85 return contents.Pass(); | 85 return contents.Pass(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace extensions | 88 } // namespace extensions |
| OLD | NEW |