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/files/scoped_temp_dir.h" |
6 #include "base/path_service.h" | 7 #include "base/path_service.h" |
7 #include "base/scoped_temp_dir.h" | |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/browser/webdata/web_apps_table.h" | 10 #include "chrome/browser/webdata/web_apps_table.h" |
11 #include "chrome/browser/webdata/web_database.h" | 11 #include "chrome/browser/webdata/web_database.h" |
12 #include "chrome/common/chrome_paths.h" | 12 #include "chrome/common/chrome_paths.h" |
13 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "third_party/skia/include/core/SkBitmap.h" | 15 #include "third_party/skia/include/core/SkBitmap.h" |
16 | 16 |
17 using base::Time; | 17 using base::Time; |
18 | 18 |
19 class WebAppsTableTest : public testing::Test { | 19 class WebAppsTableTest : public testing::Test { |
20 public: | 20 public: |
21 WebAppsTableTest() {} | 21 WebAppsTableTest() {} |
22 virtual ~WebAppsTableTest() {} | 22 virtual ~WebAppsTableTest() {} |
23 | 23 |
24 protected: | 24 protected: |
25 virtual void SetUp() { | 25 virtual void SetUp() { |
26 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 26 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
27 file_ = temp_dir_.path().AppendASCII("TestWebDatabase"); | 27 file_ = temp_dir_.path().AppendASCII("TestWebDatabase"); |
28 } | 28 } |
29 | 29 |
30 FilePath file_; | 30 FilePath file_; |
31 ScopedTempDir temp_dir_; | 31 base::ScopedTempDir temp_dir_; |
32 | 32 |
33 private: | 33 private: |
34 DISALLOW_COPY_AND_ASSIGN(WebAppsTableTest); | 34 DISALLOW_COPY_AND_ASSIGN(WebAppsTableTest); |
35 }; | 35 }; |
36 | 36 |
37 | 37 |
38 TEST_F(WebAppsTableTest, WebAppHasAllImages) { | 38 TEST_F(WebAppsTableTest, WebAppHasAllImages) { |
39 WebDatabase db; | 39 WebDatabase db; |
40 | 40 |
41 ASSERT_EQ(sql::INIT_OK, db.Init(file_)); | 41 ASSERT_EQ(sql::INIT_OK, db.Init(file_)); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 ASSERT_EQ(16, images[0].height()); | 119 ASSERT_EQ(16, images[0].height()); |
120 ASSERT_EQ(32, images[1].width()); | 120 ASSERT_EQ(32, images[1].width()); |
121 ASSERT_EQ(32, images[1].height()); | 121 ASSERT_EQ(32, images[1].height()); |
122 } else { | 122 } else { |
123 ASSERT_EQ(32, images[0].width()); | 123 ASSERT_EQ(32, images[0].width()); |
124 ASSERT_EQ(32, images[0].height()); | 124 ASSERT_EQ(32, images[0].height()); |
125 ASSERT_EQ(16, images[1].width()); | 125 ASSERT_EQ(16, images[1].width()); |
126 ASSERT_EQ(16, images[1].height()); | 126 ASSERT_EQ(16, images[1].height()); |
127 } | 127 } |
128 } | 128 } |
OLD | NEW |