| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 24 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 25 #include "chrome/test/base/in_process_browser_test.h" | 25 #include "chrome/test/base/in_process_browser_test.h" |
| 26 #include "chrome/test/base/ui_test_utils.h" | 26 #include "chrome/test/base/ui_test_utils.h" |
| 27 #include "components/content_settings/core/browser/content_settings_usages_state
.h" | 27 #include "components/content_settings/core/browser/content_settings_usages_state
.h" |
| 28 #include "components/content_settings/core/browser/host_content_settings_map.h" | 28 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 29 #include "content/public/browser/navigation_controller.h" | 29 #include "content/public/browser/navigation_controller.h" |
| 30 #include "content/public/browser/notification_details.h" | 30 #include "content/public/browser/notification_details.h" |
| 31 #include "content/public/browser/notification_service.h" | 31 #include "content/public/browser/notification_service.h" |
| 32 #include "content/public/browser/render_frame_host.h" | 32 #include "content/public/browser/render_frame_host.h" |
| 33 #include "content/public/browser/web_contents.h" | 33 #include "content/public/browser/web_contents.h" |
| 34 #include "content/public/common/geoposition.h" | |
| 35 #include "content/public/test/browser_test_utils.h" | 34 #include "content/public/test/browser_test_utils.h" |
| 35 #include "device/geolocation/geoposition.h" |
| 36 #include "net/test/embedded_test_server/embedded_test_server.h" | 36 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 37 | 37 |
| 38 namespace { | 38 namespace { |
| 39 | 39 |
| 40 std::string GetErrorCodePermissionDenied() { | 40 std::string GetErrorCodePermissionDenied() { |
| 41 return base::IntToString(content::Geoposition::ERROR_CODE_PERMISSION_DENIED); | 41 return base::IntToString(device::Geoposition::ERROR_CODE_PERMISSION_DENIED); |
| 42 } | 42 } |
| 43 | 43 |
| 44 std::string RunScript(content::RenderFrameHost* render_frame_host, | 44 std::string RunScript(content::RenderFrameHost* render_frame_host, |
| 45 const std::string& script) { | 45 const std::string& script) { |
| 46 std::string result; | 46 std::string result; |
| 47 EXPECT_TRUE(content::ExecuteScriptAndExtractString(render_frame_host, script, | 47 EXPECT_TRUE(content::ExecuteScriptAndExtractString(render_frame_host, script, |
| 48 &result)); | 48 &result)); |
| 49 return result; | 49 return result; |
| 50 } | 50 } |
| 51 | 51 |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 // Calling watchPosition should trigger the last usage update. | 758 // Calling watchPosition should trigger the last usage update. |
| 759 WatchPositionAndObservePermissionRequest(false); | 759 WatchPositionAndObservePermissionRequest(false); |
| 760 ExpectPosition(fake_latitude(), fake_longitude()); | 760 ExpectPosition(fake_latitude(), fake_longitude()); |
| 761 | 761 |
| 762 // Last usage has been updated. | 762 // Last usage has been updated. |
| 763 EXPECT_EQ(GetHostContentSettingsMap()->GetLastUsage( | 763 EXPECT_EQ(GetHostContentSettingsMap()->GetLastUsage( |
| 764 current_url().GetOrigin(), | 764 current_url().GetOrigin(), |
| 765 current_url().GetOrigin(), | 765 current_url().GetOrigin(), |
| 766 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), 13); | 766 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), 13); |
| 767 } | 767 } |
| OLD | NEW |