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

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

Issue 12225076: Delete most web intents code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 <string>
6 #include <vector>
7
8 #include "base/command_line.h"
9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/intents/native_services.h"
11 #include "chrome/browser/intents/web_intents_util.h"
12 #include "chrome/common/chrome_switches.h"
13 #include "extensions/common/url_pattern.h"
14 #include "googleurl/src/gurl.h"
15 #include "testing/gtest/include/gtest/gtest.h"
16 #include "webkit/glue/web_intent_service_data.h"
17
18 namespace {
19
20 TEST(NativeServiceRegistryTest, GetSupportedServices) {
21 #if !defined(ANDROID)
22 // enable native services feature, then check results again
23 CommandLine::ForCurrentProcess()->AppendSwitch(
24 switches::kWebIntentsNativeServicesEnabled);
25
26 web_intents::IntentServiceList services;
27 web_intents::NativeServiceRegistry registry;
28
29 registry.GetSupportedServices(ASCIIToUTF16("dothedew"), &services);
30
31 ASSERT_EQ(0U, services.size());
32
33 registry.GetSupportedServices(
34 ASCIIToUTF16(web_intents::kActionPick), &services);
35
36 ASSERT_EQ(1U, services.size());
37
38 // verify the service returned is for "pick"
39 EXPECT_EQ(ASCIIToUTF16(web_intents::kActionPick), services[0].action);
40 EXPECT_EQ(GURL(web_intents::kNativeFilePickerUrl), services[0].service_url);
41 #endif
42 }
43
44 TEST(NativeServiceRegistryTest, GetSupportedServicesDisabled) {
45 #if !defined(ANDROID)
46 web_intents::IntentServiceList services;
47 web_intents::NativeServiceRegistry registry;
48
49 registry.GetSupportedServices(
50 ASCIIToUTF16(web_intents::kActionPick), &services);
51
52 ASSERT_EQ(0U, services.size());
53 #endif
54 }
55
56 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698