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

Unified Diff: ppapi/proxy/interface_list_unittest.cc

Issue 141523010: Pepper: Log in UMA when an interface is used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased again Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/interface_list.cc ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/interface_list_unittest.cc
diff --git a/ppapi/proxy/interface_list_unittest.cc b/ppapi/proxy/interface_list_unittest.cc
index 17140f06b07fef5260281184897865468e5e5aa0..902a0a18a4a113d7f2bb9b8e49721094e7c39f3e 100644
--- a/ppapi/proxy/interface_list_unittest.cc
+++ b/ppapi/proxy/interface_list_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/hash.h"
#include "ppapi/c/ppb_core.h"
#include "ppapi/proxy/interface_list.h"
#include "ppapi/proxy/ppapi_proxy_test.h"
@@ -16,6 +17,12 @@ class InterfaceListTest : public PluginProxyTest {
const char* iface_name, void* iface_addr, Permission perm) {
list->AddPPB(iface_name, iface_addr, perm);
}
+
+ // Wrapper function so we can use the private
+ // InterfaceList::HashInterfaceName.
+ int HashInterfaceName(const std::string& name) {
+ return InterfaceList::HashInterfaceName(name);
+ }
};
// Tests looking up a stable interface.
@@ -62,5 +69,12 @@ TEST_F(InterfaceListTest, DevChannel) {
ASSERT_TRUE(list.GetInterfaceForPPB(dev_iface_name) == dev_iface_addr);
}
+// Test that the hash function provided by base::Hash is unchanged. This is so
+// that we will generate correct values when logging interface use to UMA.
+TEST_F(InterfaceListTest, InterfaceHash) {
+ EXPECT_EQ(612625164, HashInterfaceName("PPB_InputEvent;1.0"));
+ EXPECT_EQ(79708274, HashInterfaceName("PPB_TCPSocket;1.1"));
+}
+
} // namespace proxy
} // namespace ppapi
« no previous file with comments | « ppapi/proxy/interface_list.cc ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698