OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 wds_->GetWebIntents(ASCIIToUTF16("share"), &consumer); | 631 wds_->GetWebIntents(ASCIIToUTF16("share"), &consumer); |
632 WebIntentsConsumer::WaitUntilCalled(); | 632 WebIntentsConsumer::WaitUntilCalled(); |
633 ASSERT_EQ(1U, consumer.intents.size()); | 633 ASSERT_EQ(1U, consumer.intents.size()); |
634 | 634 |
635 intent.type = ASCIIToUTF16("video/*"); | 635 intent.type = ASCIIToUTF16("video/*"); |
636 EXPECT_EQ(intent.service_url, consumer.intents[0].service_url); | 636 EXPECT_EQ(intent.service_url, consumer.intents[0].service_url); |
637 EXPECT_EQ(intent.action, consumer.intents[0].action); | 637 EXPECT_EQ(intent.action, consumer.intents[0].action); |
638 EXPECT_EQ(intent.type, consumer.intents[0].type); | 638 EXPECT_EQ(intent.type, consumer.intents[0].type); |
639 } | 639 } |
640 | 640 |
| 641 TEST_F(WebDataServiceTest, WebIntentsGetAll) { |
| 642 WebIntentsConsumer consumer; |
| 643 |
| 644 WebIntentData intent; |
| 645 intent.service_url = GURL("http://google.com"); |
| 646 intent.action = ASCIIToUTF16("share"); |
| 647 intent.type = ASCIIToUTF16("image/*"); |
| 648 wds_->AddWebIntent(intent); |
| 649 |
| 650 intent.action = ASCIIToUTF16("edit"); |
| 651 wds_->AddWebIntent(intent); |
| 652 |
| 653 wds_->GetAllWebIntents(&consumer); |
| 654 WebIntentsConsumer::WaitUntilCalled(); |
| 655 ASSERT_EQ(2U, consumer.intents.size()); |
| 656 |
| 657 if (consumer.intents[0].action != ASCIIToUTF16("edit")) |
| 658 std::swap(consumer.intents[0],consumer.intents[1]); |
| 659 |
| 660 EXPECT_EQ(intent, consumer.intents[0]); |
| 661 intent.action = ASCIIToUTF16("share"); |
| 662 EXPECT_EQ(intent, consumer.intents[1]); |
| 663 } |
| 664 |
OLD | NEW |