OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/manifest/manifest_icon_selector.h" | 5 #include "chrome/browser/manifest/manifest_icon_selector.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
| 10 #include "base/macros.h" |
10 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "ui/gfx/screen.h" | 13 #include "ui/gfx/screen.h" |
13 #include "ui/gfx/screen_type_delegate.h" | 14 #include "ui/gfx/screen_type_delegate.h" |
14 #include "ui/gfx/test/test_screen.h" | 15 #include "ui/gfx/test/test_screen.h" |
15 | 16 |
16 class ManifestIconSelectorTest : public testing::Test { | 17 class ManifestIconSelectorTest : public testing::Test { |
17 protected: | 18 protected: |
18 ManifestIconSelectorTest() { | 19 ManifestIconSelectorTest() { |
19 test_screen_.display()->set_id(0x1337); | 20 test_screen_.display()->set_id(0x1337); |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 | 480 |
480 std::vector<content::Manifest::Icon> icons; | 481 std::vector<content::Manifest::Icon> icons; |
481 icons.push_back(CreateIcon("http://foo.com/icon_no.png", "", 1.0, sizes)); | 482 icons.push_back(CreateIcon("http://foo.com/icon_no.png", "", 1.0, sizes)); |
482 icons.push_back(CreateIcon("http://foo.com/icon.png", "", 3.0, sizes)); | 483 icons.push_back(CreateIcon("http://foo.com/icon.png", "", 3.0, sizes)); |
483 | 484 |
484 SetDisplayDeviceScaleFactor(3.0f); | 485 SetDisplayDeviceScaleFactor(3.0f); |
485 GURL url = FindBestMatchingIcon(icons); | 486 GURL url = FindBestMatchingIcon(icons); |
486 EXPECT_EQ("http://foo.com/icon.png", url.spec()); | 487 EXPECT_EQ("http://foo.com/icon.png", url.spec()); |
487 } | 488 } |
488 } | 489 } |
OLD | NEW |