| 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/scoped_temp_dir.h" | 6 #include "base/scoped_temp_dir.h" |
| 7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/intents/web_intents_registry.h" | 10 #include "chrome/browser/intents/web_intents_registry.h" |
| 11 #include "chrome/browser/ui/intents/web_intents_model.h" | 11 #include "chrome/browser/ui/intents/web_intents_model.h" |
| 12 #include "chrome/browser/webdata/web_data_service.h" | 12 #include "chrome/browser/webdata/web_data_service.h" |
| 13 #include "content/test/test_browser_thread.h" | 13 #include "content/test/test_browser_thread.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "ui/base/models/tree_node_model.h" | 15 #include "ui/base/models/tree_node_model.h" |
| 16 | 16 |
| 17 using content::BrowserThread; |
| 18 |
| 17 class WebIntentsModelTest : public testing::Test { | 19 class WebIntentsModelTest : public testing::Test { |
| 18 public: | 20 public: |
| 19 WebIntentsModelTest() | 21 WebIntentsModelTest() |
| 20 : ui_thread_(BrowserThread::UI, &message_loop_), | 22 : ui_thread_(BrowserThread::UI, &message_loop_), |
| 21 db_thread_(BrowserThread::DB) {} | 23 db_thread_(BrowserThread::DB) {} |
| 22 | 24 |
| 23 protected: | 25 protected: |
| 24 virtual void SetUp() { | 26 virtual void SetUp() { |
| 25 db_thread_.Start(); | 27 db_thread_.Start(); |
| 26 wds_ = new WebDataService(); | 28 wds_ = new WebDataService(); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 EXPECT_EQ(static_cast<size_t>(1), snode->Types().GetSize()); | 178 EXPECT_EQ(static_cast<size_t>(1), snode->Types().GetSize()); |
| 177 string16 stype; | 179 string16 stype; |
| 178 ASSERT_TRUE(snode->Types().GetString(0, &stype)); | 180 ASSERT_TRUE(snode->Types().GetString(0, &stype)); |
| 179 EXPECT_EQ(ASCIIToUTF16("text/url"), stype); | 181 EXPECT_EQ(ASCIIToUTF16("text/url"), stype); |
| 180 | 182 |
| 181 node = intents_model.GetTreeNode("www.digg.com"); | 183 node = intents_model.GetTreeNode("www.digg.com"); |
| 182 ASSERT_NE(static_cast<WebIntentsTreeNode*>(NULL), node); | 184 ASSERT_NE(static_cast<WebIntentsTreeNode*>(NULL), node); |
| 183 EXPECT_EQ(WebIntentsTreeNode::TYPE_ORIGIN, node->Type()); | 185 EXPECT_EQ(WebIntentsTreeNode::TYPE_ORIGIN, node->Type()); |
| 184 EXPECT_EQ(ASCIIToUTF16("www.digg.com"), node->GetTitle()); | 186 EXPECT_EQ(ASCIIToUTF16("www.digg.com"), node->GetTitle()); |
| 185 } | 187 } |
| OLD | NEW |