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

Side by Side Diff: chrome/browser/intents/web_intents_reporting_unittest.cc

Issue 12225076: Delete most web intents code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/intents/web_intents_reporting.h"
6
7 #include <vector>
8
9 #include "base/metrics/histogram.h"
10 #include "base/metrics/statistics_recorder.h"
11 #include "base/utf_string_conversions.h"
12 #include "chrome/browser/intents/web_intents_util.h"
13 #include "chrome/browser/search_engines/search_engine_type.h"
14 #include "testing/gtest/include/gtest/gtest.h"
15
16 namespace web_intents {
17 namespace reporting {
18 namespace {
19
20 const char kCustomAction[] = "jiggle";
21 const char kImageType[] = "image/png";
22 const char kCustomType[] = "http://a.b/mine";
23
24 UMABucket ToBucket(const std::string& action, const std::string& type) {
25 return web_intents::ToUMABucket(
26 ASCIIToUTF16(action), ASCIIToUTF16(type));
27 }
28
29 } // namespace
30
31 TEST(WebIntentsReportingTest, RecognizedActionAndType) {
32 EXPECT_EQ(BUCKET_SHARE_IMAGE, ToBucket(kActionShare, kImageType));
33 }
34
35 TEST(WebIntentsReportingTest, CustomAction) {
36 EXPECT_EQ(BUCKET_CUSTOM_IMAGE, ToBucket(kCustomAction, kImageType));
37 }
38
39 TEST(WebIntentsReportingTest, CustomType) {
40 EXPECT_EQ(BUCKET_EDIT_CUSTOM, ToBucket(kActionEdit, kCustomType));
41 }
42
43 TEST(WebIntentsReportingTest, CustomActionAndType) {
44 EXPECT_EQ(BUCKET_CUSTOM_CUSTOM, ToBucket(kCustomAction, kCustomType));
45 }
46
47 } // namespace reporting
48 } // namespace web_intents
OLDNEW
« no previous file with comments | « chrome/browser/intents/web_intents_reporting.cc ('k') | chrome/browser/intents/web_intents_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698