Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(809)

Side by Side Diff: chrome/browser/extensions/api/web_navigation/web_navigation_unittest.cc

Issue 9959097: Move webNavigation extension api into a separate directory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // Tests common functionality used by the Chrome Extensions webNavigation API 5 // Tests common functionality used by the Chrome Extensions webNavigation API
6 // implementation. 6 // implementation.
7 7
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/extension_webnavigation_api.h" 9 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h"
10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
11 #include "chrome/test/base/testing_profile.h" 11 #include "chrome/test/base/testing_profile.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace extensions {
14 15
15 class FrameNavigationStateTest : public ChromeRenderViewHostTestHarness { 16 class FrameNavigationStateTest : public ChromeRenderViewHostTestHarness {
16 }; 17 };
17 18
18 // Test that a frame is correctly tracked, and removed once the tab contents 19 // Test that a frame is correctly tracked, and removed once the tab contents
19 // goes away. 20 // goes away.
20 TEST_F(FrameNavigationStateTest, TrackFrame) { 21 TEST_F(FrameNavigationStateTest, TrackFrame) {
21 FrameNavigationState navigation_state; 22 FrameNavigationState navigation_state;
22 const int64 frame_id1 = 23; 23 const int64 frame_id1 = 23;
23 const int64 frame_id2 = 42; 24 const int64 frame_id2 = 42;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 105
105 // Tests that no events are send for a not web-safe scheme. 106 // Tests that no events are send for a not web-safe scheme.
106 TEST_F(FrameNavigationStateTest, WebSafeScheme) { 107 TEST_F(FrameNavigationStateTest, WebSafeScheme) {
107 FrameNavigationState navigation_state; 108 FrameNavigationState navigation_state;
108 const int64 frame_id = 23; 109 const int64 frame_id = 23;
109 const GURL url("unsafe://www.google.com/"); 110 const GURL url("unsafe://www.google.com/");
110 111
111 navigation_state.TrackFrame(frame_id, url, true, false); 112 navigation_state.TrackFrame(frame_id, url, true, false);
112 EXPECT_FALSE(navigation_state.CanSendEvents(frame_id)); 113 EXPECT_FALSE(navigation_state.CanSendEvents(frame_id));
113 } 114 }
115
116 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698