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

Side by Side Diff: chrome/browser/extensions/webstore_installer_browsertest.cc

Issue 1739183003: Make extensions::DictionaryBuilder and extensions::ListValue unmovable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/webstore_installer.h" 5 #include "chrome/browser/extensions/webstore_installer.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 done_closure_.Run(); 116 done_closure_.Run();
117 } 117 }
118 118
119 IN_PROC_BROWSER_TEST_F(WebstoreInstallerBrowserTest, WebstoreInstall) { 119 IN_PROC_BROWSER_TEST_F(WebstoreInstallerBrowserTest, WebstoreInstall) {
120 scoped_ptr<base::DictionaryValue> manifest( 120 scoped_ptr<base::DictionaryValue> manifest(
121 DictionaryBuilder() 121 DictionaryBuilder()
122 .Set("name", kExtensionName) 122 .Set("name", kExtensionName)
123 .Set("description", "Foo") 123 .Set("description", "Foo")
124 .Set("manifest_version", 2) 124 .Set("manifest_version", 2)
125 .Set("version", "1.0") 125 .Set("version", "1.0")
126 .Set("permissions", std::move(ListBuilder().Append("tabs"))) 126 .Set("permissions", ListBuilder().Append("tabs").Build())
127 .Build()); 127 .Build());
128 128
129 content::WebContents* active_web_contents = 129 content::WebContents* active_web_contents =
130 browser()->tab_strip_model()->GetActiveWebContents(); 130 browser()->tab_strip_model()->GetActiveWebContents();
131 ASSERT_TRUE(active_web_contents); 131 ASSERT_TRUE(active_web_contents);
132 132
133 // Create an approval. 133 // Create an approval.
134 scoped_ptr<WebstoreInstaller::Approval> approval = 134 scoped_ptr<WebstoreInstaller::Approval> approval =
135 WebstoreInstaller::Approval::CreateWithNoInstallPrompt( 135 WebstoreInstaller::Approval::CreateWithNoInstallPrompt(
136 browser()->profile(), kTestExtensionId, std::move(manifest), false); 136 browser()->profile(), kTestExtensionId, std::move(manifest), false);
(...skipping 12 matching lines...) Expand all
149 ASSERT_TRUE(registry->enabled_extensions().GetByID(kTestExtensionId)); 149 ASSERT_TRUE(registry->enabled_extensions().GetByID(kTestExtensionId));
150 } 150 }
151 151
152 IN_PROC_BROWSER_TEST_F(WebstoreInstallerBrowserTest, SimultaneousInstall) { 152 IN_PROC_BROWSER_TEST_F(WebstoreInstallerBrowserTest, SimultaneousInstall) {
153 scoped_ptr<base::DictionaryValue> manifest( 153 scoped_ptr<base::DictionaryValue> manifest(
154 DictionaryBuilder() 154 DictionaryBuilder()
155 .Set("name", kExtensionName) 155 .Set("name", kExtensionName)
156 .Set("description", "Foo") 156 .Set("description", "Foo")
157 .Set("manifest_version", 2) 157 .Set("manifest_version", 2)
158 .Set("version", "1.0") 158 .Set("version", "1.0")
159 .Set("permissions", std::move(ListBuilder().Append("tabs"))) 159 .Set("permissions", ListBuilder().Append("tabs").Build())
160 .Build()); 160 .Build());
161 161
162 content::WebContents* active_web_contents = 162 content::WebContents* active_web_contents =
163 browser()->tab_strip_model()->GetActiveWebContents(); 163 browser()->tab_strip_model()->GetActiveWebContents();
164 ASSERT_TRUE(active_web_contents); 164 ASSERT_TRUE(active_web_contents);
165 165
166 // Create an approval. 166 // Create an approval.
167 scoped_ptr<WebstoreInstaller::Approval> approval = 167 scoped_ptr<WebstoreInstaller::Approval> approval =
168 WebstoreInstaller::Approval::CreateWithNoInstallPrompt( 168 WebstoreInstaller::Approval::CreateWithNoInstallPrompt(
169 browser()->profile(), 169 browser()->profile(),
(...skipping 29 matching lines...) Expand all
199 installer = nullptr; 199 installer = nullptr;
200 run_loop2.Run(); 200 run_loop2.Run();
201 201
202 EXPECT_TRUE(success()); 202 EXPECT_TRUE(success());
203 ExtensionRegistry* registry = ExtensionRegistry::Get(profile()); 203 ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
204 // Extension ends up as disabled because of permissions. 204 // Extension ends up as disabled because of permissions.
205 ASSERT_TRUE(registry->disabled_extensions().GetByID(kTestExtensionId)); 205 ASSERT_TRUE(registry->disabled_extensions().GetByID(kTestExtensionId));
206 } 206 }
207 207
208 } // namespace extensions 208 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698