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

Side by Side Diff: ios/chrome/browser/ui/activity_services/activity_service_controller_unittest.mm

Issue 2710923002: Rename UIActivityFindLoginActionSource to UIActivityURLSource. (Closed)
Patch Set: Created 3 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
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 #import "ios/chrome/browser/ui/activity_services/activity_service_controller.h" 5 #import "ios/chrome/browser/ui/activity_services/activity_service_controller.h"
6 6
7 #import <MobileCoreServices/MobileCoreServices.h> 7 #import <MobileCoreServices/MobileCoreServices.h>
8 8
9 #import "base/test/ios/wait_util.h" 9 #import "base/test/ios/wait_util.h"
10 #include "components/reading_list/core/reading_list_switches.h" 10 #include "components/reading_list/core/reading_list_switches.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 // Checks version. 300 // Checks version.
301 NSNumber* version = 301 NSNumber* version =
302 [result objectForKey:activity_services::kPasswordAppExVersionNumberKey]; 302 [result objectForKey:activity_services::kPasswordAppExVersionNumberKey];
303 EXPECT_NSEQ(activity_services::kPasswordAppExVersionNumber, version); 303 EXPECT_NSEQ(activity_services::kPasswordAppExVersionNumber, version);
304 // Checks URL. 304 // Checks URL.
305 NSString* appExUrlString = 305 NSString* appExUrlString =
306 [result objectForKey:activity_services::kPasswordAppExURLStringKey]; 306 [result objectForKey:activity_services::kPasswordAppExURLStringKey];
307 EXPECT_NSEQ(@"https://chromium.org/login.html", appExUrlString); 307 EXPECT_NSEQ(@"https://chromium.org/login.html", appExUrlString);
308 308
309 // Checks that the list includes the page's title. 309 // Checks that the list includes the page's title.
310 NSArray* sources = 310 NSArray* sources = FindItemsOfClass(items, [UIActivityURLSource class]);
311 FindItemsOfClass(items, [UIActivityFindLoginActionSource class]);
312 EXPECT_EQ(1U, [sources count]); 311 EXPECT_EQ(1U, [sources count]);
313 UIActivityFindLoginActionSource* actionSource = sources[0]; 312 UIActivityURLSource* actionSource = sources[0];
314 id mockActivityViewController = 313 id mockActivityViewController =
315 [OCMockObject niceMockForClass:[UIActivityViewController class]]; 314 [OCMockObject niceMockForClass:[UIActivityViewController class]];
316 NSString* title = [actionSource 315 NSString* title = [actionSource
317 activityViewController:mockActivityViewController 316 activityViewController:mockActivityViewController
318 subjectForActivityType:activity_services::kAppExtensionOnePassword]; 317 subjectForActivityType:activity_services::kAppExtensionOnePassword];
319 EXPECT_NSEQ(@"kung fu fighting", title); 318 EXPECT_NSEQ(@"kung fu fighting", title);
320 } 319 }
321 320
322 // Verifies that a Share extension can fetch a URL when Password App Extension 321 // Verifies that a Share extension can fetch a URL when Password App Extension
323 // is enabled. 322 // is enabled.
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 // public.url UTType in order to allow Share actions (e.g. Facebook, Twitter, 481 // public.url UTType in order to allow Share actions (e.g. Facebook, Twitter,
483 // etc) to appear on UIActivityViewController opened by Chrome). 482 // etc) to appear on UIActivityViewController opened by Chrome).
484 CFStringRef chromeFindLoginAction = reinterpret_cast<CFStringRef>( 483 CFStringRef chromeFindLoginAction = reinterpret_cast<CFStringRef>(
485 activity_services::kUTTypeAppExtensionFindLoginAction); 484 activity_services::kUTTypeAppExtensionFindLoginAction);
486 EXPECT_TRUE(UTTypeConformsTo(chromeFindLoginAction, kUTTypeURL)); 485 EXPECT_TRUE(UTTypeConformsTo(chromeFindLoginAction, kUTTypeURL));
487 EXPECT_TRUE( 486 EXPECT_TRUE(
488 UTTypeConformsTo(chromeFindLoginAction, onePasswordFindLoginAction)); 487 UTTypeConformsTo(chromeFindLoginAction, onePasswordFindLoginAction));
489 } 488 }
490 489
491 } // namespace 490 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698