OLD | NEW |
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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/scoped_temp_dir.h" | 7 #include "base/scoped_temp_dir.h" |
8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/intents/web_intents_registry.h" | 11 #include "chrome/browser/intents/web_intents_registry.h" |
12 #include "chrome/browser/ui/intents/web_intents_model.h" | 12 #include "chrome/browser/ui/intents/web_intents_model.h" |
13 #include "chrome/browser/webdata/web_data_service.h" | 13 #include "chrome/browser/webdata/web_data_service.h" |
14 #include "content/test/test_browser_thread.h" | 14 #include "content/public/test/test_browser_thread.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "ui/base/models/tree_node_model.h" | 16 #include "ui/base/models/tree_node_model.h" |
17 | 17 |
18 using content::BrowserThread; | 18 using content::BrowserThread; |
19 | 19 |
20 class WebIntentsModelTest : public testing::Test { | 20 class WebIntentsModelTest : public testing::Test { |
21 public: | 21 public: |
22 WebIntentsModelTest() | 22 WebIntentsModelTest() |
23 : ui_thread_(BrowserThread::UI, &message_loop_), | 23 : ui_thread_(BrowserThread::UI, &message_loop_), |
24 db_thread_(BrowserThread::DB) {} | 24 db_thread_(BrowserThread::DB) {} |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 206 |
207 WebIntentsTreeNode* node = intents_model.GetTreeNode("www.google.com"); | 207 WebIntentsTreeNode* node = intents_model.GetTreeNode("www.google.com"); |
208 ASSERT_EQ(2, node->child_count()); | 208 ASSERT_EQ(2, node->child_count()); |
209 node = node->GetChild(1); | 209 node = node->GetChild(1); |
210 ASSERT_EQ(WebIntentsTreeNode::TYPE_SERVICE, node->Type()); | 210 ASSERT_EQ(WebIntentsTreeNode::TYPE_SERVICE, node->Type()); |
211 ASSERT_EQ(WebIntentsTreeNode::TYPE_SERVICE, node->Type()); | 211 ASSERT_EQ(WebIntentsTreeNode::TYPE_SERVICE, node->Type()); |
212 ServiceTreeNode* snode = static_cast<ServiceTreeNode*>(node); | 212 ServiceTreeNode* snode = static_cast<ServiceTreeNode*>(node); |
213 EXPECT_EQ(ASCIIToUTF16("XEDIT"), snode->Action()); | 213 EXPECT_EQ(ASCIIToUTF16("XEDIT"), snode->Action()); |
214 EXPECT_EQ(ASCIIToUTF16("http://www.google.com/xedit"), snode->ServiceUrl()); | 214 EXPECT_EQ(ASCIIToUTF16("http://www.google.com/xedit"), snode->ServiceUrl()); |
215 } | 215 } |
OLD | NEW |