| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/importer/profile_writer.h" | 5 #include "chrome/browser/importer/profile_writer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "content/public/test/test_browser_thread.h" | 22 #include "content/public/test/test_browser_thread.h" |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 24 | 24 |
| 25 using bookmarks::BookmarkMatch; | 25 using bookmarks::BookmarkMatch; |
| 26 using content::BrowserThread; | 26 using content::BrowserThread; |
| 27 | 27 |
| 28 class TestProfileWriter : public ProfileWriter { | 28 class TestProfileWriter : public ProfileWriter { |
| 29 public: | 29 public: |
| 30 explicit TestProfileWriter(Profile* profile) : ProfileWriter(profile) {} | 30 explicit TestProfileWriter(Profile* profile) : ProfileWriter(profile) {} |
| 31 protected: | 31 protected: |
| 32 virtual ~TestProfileWriter() {} | 32 ~TestProfileWriter() override {} |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 class ProfileWriterTest : public testing::Test { | 35 class ProfileWriterTest : public testing::Test { |
| 36 public: | 36 public: |
| 37 ProfileWriterTest() | 37 ProfileWriterTest() |
| 38 : ui_thread_(BrowserThread::UI, &loop_), | 38 : ui_thread_(BrowserThread::UI, &loop_), |
| 39 file_thread_(BrowserThread::FILE, &loop_) { | 39 file_thread_(BrowserThread::FILE, &loop_) { |
| 40 } | 40 } |
| 41 virtual ~ProfileWriterTest() {} | 41 virtual ~ProfileWriterTest() {} |
| 42 | 42 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 new TestProfileWriter(&profile)); | 203 new TestProfileWriter(&profile)); |
| 204 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED); | 204 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED); |
| 205 VerifyHistoryCount(&profile); | 205 VerifyHistoryCount(&profile); |
| 206 size_t original_history_count = history_count_; | 206 size_t original_history_count = history_count_; |
| 207 history_count_ = 0; | 207 history_count_ = 0; |
| 208 | 208 |
| 209 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED); | 209 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED); |
| 210 VerifyHistoryCount(&profile); | 210 VerifyHistoryCount(&profile); |
| 211 EXPECT_EQ(original_history_count, history_count_); | 211 EXPECT_EQ(original_history_count, history_count_); |
| 212 } | 212 } |
| OLD | NEW |