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

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

Issue 2774603002: Removes the IsReadingListEnabled flags (Closed)
Patch Set: fix tests Created 3 years, 9 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"
11 #import "ios/chrome/browser/ui/activity_services/activity_type_util.h" 10 #import "ios/chrome/browser/ui/activity_services/activity_type_util.h"
12 #import "ios/chrome/browser/ui/activity_services/appex_constants.h" 11 #import "ios/chrome/browser/ui/activity_services/appex_constants.h"
13 #import "ios/chrome/browser/ui/activity_services/chrome_activity_item_source.h" 12 #import "ios/chrome/browser/ui/activity_services/chrome_activity_item_source.h"
14 #import "ios/chrome/browser/ui/activity_services/print_activity.h" 13 #import "ios/chrome/browser/ui/activity_services/print_activity.h"
15 #import "ios/chrome/browser/ui/activity_services/share_to_data.h" 14 #import "ios/chrome/browser/ui/activity_services/share_to_data.h"
16 #include "ios/web/public/test/test_web_thread_bundle.h" 15 #include "ios/web/public/test/test_web_thread_bundle.h"
17 #include "testing/gtest_mac.h" 16 #include "testing/gtest_mac.h"
18 #include "testing/platform_test.h" 17 #include "testing/platform_test.h"
19 #import "third_party/ocmock/OCMock/OCMock.h" 18 #import "third_party/ocmock/OCMock/OCMock.h"
20 #import "third_party/ocmock/gtest_support.h" 19 #import "third_party/ocmock/gtest_support.h"
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 // Verify printable data. 434 // Verify printable data.
436 ShareToData* data = 435 ShareToData* data =
437 [[ShareToData alloc] initWithURL:GURL("https://chromium.org/printable") 436 [[ShareToData alloc] initWithURL:GURL("https://chromium.org/printable")
438 title:@"bar" 437 title:@"bar"
439 isOriginalTitle:YES 438 isOriginalTitle:YES
440 isPagePrintable:YES 439 isPagePrintable:YES
441 thumbnailGenerator:DummyThumbnailGeneratorBlock()]; 440 thumbnailGenerator:DummyThumbnailGeneratorBlock()];
442 441
443 NSArray* items = 442 NSArray* items =
444 [activityController applicationActivitiesForData:data controller:nil]; 443 [activityController applicationActivitiesForData:data controller:nil];
445 NSUInteger expected_items_count = 444 ASSERT_EQ(2U, [items count]);
446 reading_list::switches::IsReadingListEnabled() ? 2U : 1U;
447 ASSERT_EQ(expected_items_count, [items count]);
448 EXPECT_EQ([PrintActivity class], [[items objectAtIndex:0] class]); 445 EXPECT_EQ([PrintActivity class], [[items objectAtIndex:0] class]);
449 446
450 // Verify non-printable data. 447 // Verify non-printable data.
451 data = 448 data =
452 [[ShareToData alloc] initWithURL:GURL("https://chromium.org/unprintable") 449 [[ShareToData alloc] initWithURL:GURL("https://chromium.org/unprintable")
453 title:@"baz" 450 title:@"baz"
454 isOriginalTitle:YES 451 isOriginalTitle:YES
455 isPagePrintable:NO 452 isPagePrintable:NO
456 thumbnailGenerator:DummyThumbnailGeneratorBlock()]; 453 thumbnailGenerator:DummyThumbnailGeneratorBlock()];
457 items = [activityController applicationActivitiesForData:data controller:nil]; 454 items = [activityController applicationActivitiesForData:data controller:nil];
458 EXPECT_EQ(expected_items_count - 1, [items count]); 455 EXPECT_EQ(1U, [items count]);
459 } 456 }
460 457
461 TEST_F(ActivityServiceControllerTest, FindLoginActionTypeConformsToPublicURL) { 458 TEST_F(ActivityServiceControllerTest, FindLoginActionTypeConformsToPublicURL) {
462 // If this test fails, it is probably due to missing or incorrect 459 // If this test fails, it is probably due to missing or incorrect
463 // UTImportedTypeDeclarations in Info.plist. Note that there are 460 // UTImportedTypeDeclarations in Info.plist. Note that there are
464 // two Info.plist, 461 // two Info.plist,
465 // - ios/chrome/app/resources/Info.plist for Chrome app 462 // - ios/chrome/app/resources/Info.plist for Chrome app
466 // - testing/gtest_ios/unittest-Info.plist for ios_chrome_unittests 463 // - testing/gtest_ios/unittest-Info.plist for ios_chrome_unittests
467 // Both of them must be changed. 464 // Both of them must be changed.
468 465
(...skipping 12 matching lines...) Expand all
481 // public.url UTType in order to allow Share actions (e.g. Facebook, Twitter, 478 // public.url UTType in order to allow Share actions (e.g. Facebook, Twitter,
482 // etc) to appear on UIActivityViewController opened by Chrome). 479 // etc) to appear on UIActivityViewController opened by Chrome).
483 CFStringRef chromeFindLoginAction = reinterpret_cast<CFStringRef>( 480 CFStringRef chromeFindLoginAction = reinterpret_cast<CFStringRef>(
484 activity_services::kUTTypeAppExtensionFindLoginAction); 481 activity_services::kUTTypeAppExtensionFindLoginAction);
485 EXPECT_TRUE(UTTypeConformsTo(chromeFindLoginAction, kUTTypeURL)); 482 EXPECT_TRUE(UTTypeConformsTo(chromeFindLoginAction, kUTTypeURL));
486 EXPECT_TRUE( 483 EXPECT_TRUE(
487 UTTypeConformsTo(chromeFindLoginAction, onePasswordFindLoginAction)); 484 UTTypeConformsTo(chromeFindLoginAction, onePasswordFindLoginAction));
488 } 485 }
489 486
490 } // namespace 487 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698