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

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

Issue 10384072: Update to handle absolute-looking paths in manifests and still produce nice-looking URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head Created 8 years, 7 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
« no previous file with comments | « no previous file | chrome/common/extensions/extension.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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/bind.h" 5 #include "base/bind.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/json/json_file_value_serializer.h" 7 #include "base/json/json_file_value_serializer.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 TestConsumer consumer; 233 TestConsumer consumer;
234 registry_.GetIntentServicesForExtensionFilter( 234 registry_.GetIntentServicesForExtensionFilter(
235 ASCIIToUTF16("http://webintents.org/edit"), 235 ASCIIToUTF16("http://webintents.org/edit"),
236 ASCIIToUTF16("image/*"), 236 ASCIIToUTF16("image/*"),
237 edit_extension->id(), 237 edit_extension->id(),
238 base::Bind(&TestConsumer::OnIntentsQueryDone, 238 base::Bind(&TestConsumer::OnIntentsQueryDone,
239 base::Unretained(&consumer))); 239 base::Unretained(&consumer)));
240 consumer.WaitForData(); 240 consumer.WaitForData();
241 ASSERT_EQ(1U, consumer.services_.size()); 241 ASSERT_EQ(1U, consumer.services_.size());
242
243 EXPECT_EQ(edit_extension->url().spec() + "services/edit",
244 consumer.services_[0].service_url.spec());
242 } 245 }
243 246
244 TEST_F(WebIntentsRegistryTest, GetAllIntents) { 247 TEST_F(WebIntentsRegistryTest, GetAllIntents) {
245 webkit_glue::WebIntentServiceData service; 248 webkit_glue::WebIntentServiceData service;
246 service.service_url = GURL("http://google.com"); 249 service.service_url = GURL("http://google.com");
247 service.action = ASCIIToUTF16("share"); 250 service.action = ASCIIToUTF16("share");
248 service.type = ASCIIToUTF16("image/*"); 251 service.type = ASCIIToUTF16("image/*");
249 service.title = ASCIIToUTF16("Google's Sharing Service"); 252 service.title = ASCIIToUTF16("Google's Sharing Service");
250 registry_.RegisterIntentService(service); 253 registry_.RegisterIntentService(service);
251 254
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 TestConsumer consumer; 635 TestConsumer consumer;
633 registry_.GetIntentServices(ASCIIToUTF16("http://webintents.org/share"), 636 registry_.GetIntentServices(ASCIIToUTF16("http://webintents.org/share"),
634 ASCIIToUTF16("image/*"), 637 ASCIIToUTF16("image/*"),
635 base::Bind(&TestConsumer::OnIntentsQueryDone, 638 base::Bind(&TestConsumer::OnIntentsQueryDone,
636 base::Unretained(&consumer))); 639 base::Unretained(&consumer)));
637 640
638 consumer.WaitForData(); 641 consumer.WaitForData();
639 ASSERT_EQ(1U, consumer.services_.size()); 642 ASSERT_EQ(1U, consumer.services_.size());
640 EXPECT_EQ(ASCIIToUTF16("image/png,image/jpg"), consumer.services_[0].type); 643 EXPECT_EQ(ASCIIToUTF16("image/png,image/jpg"), consumer.services_[0].type);
641 } 644 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698