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

Side by Side Diff: chrome/common/extensions/permissions/chrome_permission_message_provider_unittest.cc

Issue 1321333003: Reorder permission message rules, so that related rules appear together (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@optional_rules
Patch Set: fix test Created 5 years, 3 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/common/extensions/permissions/chrome_permission_message_provide r.h" 5 #include "chrome/common/extensions/permissions/chrome_permission_message_provide r.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 ASSERT_TRUE(usb->FromValue(devices_list.get(), nullptr, nullptr)); 101 ASSERT_TRUE(usb->FromValue(devices_list.get(), nullptr, nullptr));
102 permissions.insert(usb.release()); 102 permissions.insert(usb.release());
103 103
104 PermissionMessages messages = 104 PermissionMessages messages =
105 GetMessages(permissions, Manifest::TYPE_EXTENSION); 105 GetMessages(permissions, Manifest::TYPE_EXTENSION);
106 106
107 ASSERT_EQ(2U, messages.size()); 107 ASSERT_EQ(2U, messages.size());
108 auto it = messages.begin(); 108 auto it = messages.begin();
109 const PermissionMessage& message0 = *it++; 109 const PermissionMessage& message0 = *it++;
110 EXPECT_EQ( 110 EXPECT_EQ(
111 l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_USB_DEVICE_LIST), 111 l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_HISTORY_READ),
Marc Treib 2015/09/01 13:16:07 Here, the order of the two messages changed. We do
112 message0.message()); 112 message0.message());
113 EXPECT_FALSE(message0.submessages().empty()); 113 EXPECT_TRUE(message0.submessages().empty());
114 const PermissionMessage& message1 = *it++; 114 const PermissionMessage& message1 = *it++;
115 EXPECT_EQ( 115 EXPECT_EQ(
116 l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_HISTORY_READ), 116 l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_USB_DEVICE_LIST),
117 message1.message()); 117 message1.message());
118 EXPECT_TRUE(message1.submessages().empty()); 118 EXPECT_FALSE(message1.submessages().empty());
119 } 119 }
120 120
121 } // namespace extensions 121 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698