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

Side by Side Diff: chrome/common/extensions/extension_set_unittest.cc

Issue 6766002: Replace bools in extension creation with flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/file_path.h" 5 #include "base/file_path.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/common/extensions/extension.h" 10 #include "chrome/common/extensions/extension.h"
(...skipping 18 matching lines...) Expand all
29 29
30 if (!launch_url.empty()) 30 if (!launch_url.empty())
31 manifest.SetString("app.launch.web_url", launch_url); 31 manifest.SetString("app.launch.web_url", launch_url);
32 32
33 if (!extent.empty()) { 33 if (!extent.empty()) {
34 ListValue* urls = new ListValue(); 34 ListValue* urls = new ListValue();
35 manifest.Set("app.urls", urls); 35 manifest.Set("app.urls", urls);
36 urls->Append(Value::CreateStringValue(extent)); 36 urls->Append(Value::CreateStringValue(extent));
37 } 37 }
38 38
39 const bool kRequireKey = false;
40 const bool kStrictErrorChecks = true;
41 std::string error; 39 std::string error;
42 scoped_refptr<Extension> extension( 40 scoped_refptr<Extension> extension(
43 Extension::Create(path, Extension::INTERNAL, manifest, kRequireKey, 41 Extension::Create(path, Extension::INTERNAL, manifest,
44 kStrictErrorChecks, &error)); 42 Extension::STRICT_ERROR_CHECKS, &error));
45 EXPECT_TRUE(extension.get()) << error; 43 EXPECT_TRUE(extension.get()) << error;
46 return extension; 44 return extension;
47 } 45 }
48 46
49 } // namespace 47 } // namespace
50 48
51 TEST(ExtensionSetTest, ExtensionSet) { 49 TEST(ExtensionSetTest, ExtensionSet) {
52 scoped_refptr<Extension> ext1(CreateTestExtension( 50 scoped_refptr<Extension> ext1(CreateTestExtension(
53 "a", "https://chrome.google.com/launch", "https://chrome.google.com/")); 51 "a", "https://chrome.google.com/launch", "https://chrome.google.com/"));
54 52
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // Both of these should be NULL, which mean true for InSameExtent. 108 // Both of these should be NULL, which mean true for InSameExtent.
111 EXPECT_TRUE(extensions.InSameExtent( 109 EXPECT_TRUE(extensions.InSameExtent(
112 GURL("http://www.google.com/"), 110 GURL("http://www.google.com/"),
113 GURL("http://blog.chromium.org/"))); 111 GURL("http://blog.chromium.org/")));
114 112
115 // Remove one of the extensions. 113 // Remove one of the extensions.
116 extensions.Remove(ext2->id()); 114 extensions.Remove(ext2->id());
117 EXPECT_EQ(2u, extensions.size()); 115 EXPECT_EQ(2u, extensions.size());
118 EXPECT_FALSE(extensions.GetByID(ext2->id())); 116 EXPECT_FALSE(extensions.GetByID(ext2->id()));
119 } 117 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698