| 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 | 5 |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 | 785 |
| 786 scoped_ptr<base::DictionaryValue> get_zoom_settings_result( | 786 scoped_ptr<base::DictionaryValue> get_zoom_settings_result( |
| 787 utils::ToDictionary(utils::RunFunctionAndReturnSingleResult( | 787 utils::ToDictionary(utils::RunFunctionAndReturnSingleResult( |
| 788 get_zoom_settings_function.get(), | 788 get_zoom_settings_function.get(), |
| 789 base::StringPrintf("[%u]", tab_id), | 789 base::StringPrintf("[%u]", tab_id), |
| 790 browser()))); | 790 browser()))); |
| 791 | 791 |
| 792 if (!get_zoom_settings_result) | 792 if (!get_zoom_settings_result) |
| 793 return testing::AssertionFailure() << "no result"; | 793 return testing::AssertionFailure() << "no result"; |
| 794 | 794 |
| 795 if (!get_zoom_settings_result->GetDouble("default_zoom_factor", | 795 if (!get_zoom_settings_result->GetDouble("defaultZoomFactor", |
| 796 default_zoom_factor)) { | 796 default_zoom_factor)) { |
| 797 return testing::AssertionFailure() | 797 return testing::AssertionFailure() |
| 798 << "default zoom factor not found in result"; | 798 << "default zoom factor not found in result"; |
| 799 } | 799 } |
| 800 | 800 |
| 801 return testing::AssertionSuccess(); | 801 return testing::AssertionSuccess(); |
| 802 } | 802 } |
| 803 | 803 |
| 804 std::string ExtensionTabsZoomTest::RunSetZoomExpectError(int tab_id, | 804 std::string ExtensionTabsZoomTest::RunSetZoomExpectError(int tab_id, |
| 805 double zoom_factor) { | 805 double zoom_factor) { |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 // Test chrome.tabs.setZoom(). | 1085 // Test chrome.tabs.setZoom(). |
| 1086 error = RunSetZoomExpectError(tab_id, 3.14159); | 1086 error = RunSetZoomExpectError(tab_id, 3.14159); |
| 1087 EXPECT_TRUE(MatchPattern(error, manifest_errors::kCannotAccessChromeUrl)); | 1087 EXPECT_TRUE(MatchPattern(error, manifest_errors::kCannotAccessChromeUrl)); |
| 1088 | 1088 |
| 1089 // chrome.tabs.setZoomSettings(). | 1089 // chrome.tabs.setZoomSettings(). |
| 1090 error = RunSetZoomSettingsExpectError(tab_id, "manual", "per-tab"); | 1090 error = RunSetZoomSettingsExpectError(tab_id, "manual", "per-tab"); |
| 1091 EXPECT_TRUE(MatchPattern(error, manifest_errors::kCannotAccessChromeUrl)); | 1091 EXPECT_TRUE(MatchPattern(error, manifest_errors::kCannotAccessChromeUrl)); |
| 1092 } | 1092 } |
| 1093 | 1093 |
| 1094 } // namespace extensions | 1094 } // namespace extensions |
| OLD | NEW |