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

Side by Side Diff: content/renderer/render_view_browsertest.cc

Issue 2694413006: Scope and clean up uses of AccessibilityMode. (Closed)
Patch Set: build bustage Created 3 years, 10 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
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 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <tuple> 7 #include <tuple>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after
1966 request.setRequestContext(blink::WebURLRequest::RequestContextSubresource); 1966 request.setRequestContext(blink::WebURLRequest::RequestContextSubresource);
1967 blink::WebURLResponse redirect_response; 1967 blink::WebURLResponse redirect_response;
1968 frame()->willSendRequest(GetMainFrame(), request); 1968 frame()->willSendRequest(GetMainFrame(), request);
1969 extra_data = static_cast<RequestExtraData*>(request.getExtraData()); 1969 extra_data = static_cast<RequestExtraData*>(request.getExtraData());
1970 ASSERT_TRUE(extra_data); 1970 ASSERT_TRUE(extra_data);
1971 EXPECT_EQ(extra_data->service_worker_provider_id(), 1971 EXPECT_EQ(extra_data->service_worker_provider_id(),
1972 provider->provider_id()); 1972 provider->provider_id());
1973 } 1973 }
1974 1974
1975 TEST_F(RenderViewImplTest, OnSetAccessibilityMode) { 1975 TEST_F(RenderViewImplTest, OnSetAccessibilityMode) {
1976 ASSERT_EQ(AccessibilityModeOff, frame()->accessibility_mode()); 1976 ASSERT_EQ(AccessibilityMode::OFF, frame()->accessibility_mode());
1977 ASSERT_FALSE(frame()->render_accessibility()); 1977 ASSERT_FALSE(frame()->render_accessibility());
1978 1978
1979 frame()->SetAccessibilityMode(ACCESSIBILITY_MODE_WEB_CONTENTS_ONLY); 1979 frame()->SetAccessibilityMode(AccessibilityMode::WEB_CONTENTS_ONLY);
1980 ASSERT_EQ(ACCESSIBILITY_MODE_WEB_CONTENTS_ONLY, 1980 ASSERT_EQ(AccessibilityMode::WEB_CONTENTS_ONLY,
1981 frame()->accessibility_mode()); 1981 frame()->accessibility_mode());
1982 ASSERT_TRUE(frame()->render_accessibility()); 1982 ASSERT_TRUE(frame()->render_accessibility());
1983 1983
1984 frame()->SetAccessibilityMode(AccessibilityModeOff); 1984 frame()->SetAccessibilityMode(AccessibilityMode::OFF);
1985 ASSERT_EQ(AccessibilityModeOff, frame()->accessibility_mode()); 1985 ASSERT_EQ(AccessibilityMode::OFF, frame()->accessibility_mode());
1986 ASSERT_FALSE(frame()->render_accessibility()); 1986 ASSERT_FALSE(frame()->render_accessibility());
1987 1987
1988 frame()->SetAccessibilityMode(ACCESSIBILITY_MODE_COMPLETE); 1988 frame()->SetAccessibilityMode(AccessibilityMode::COMPLETE);
1989 ASSERT_EQ(ACCESSIBILITY_MODE_COMPLETE, frame()->accessibility_mode()); 1989 ASSERT_EQ(AccessibilityMode::COMPLETE, frame()->accessibility_mode());
1990 ASSERT_TRUE(frame()->render_accessibility()); 1990 ASSERT_TRUE(frame()->render_accessibility());
1991 } 1991 }
1992 1992
1993 // Checks that when a navigation starts in the renderer, |navigation_start| is 1993 // Checks that when a navigation starts in the renderer, |navigation_start| is
1994 // recorded at an appropriate time and is passed in the corresponding message. 1994 // recorded at an appropriate time and is passed in the corresponding message.
1995 TEST_F(RenderViewImplTest, RendererNavigationStartTransmittedToBrowser) { 1995 TEST_F(RenderViewImplTest, RendererNavigationStartTransmittedToBrowser) {
1996 base::TimeTicks lower_bound_navigation_start(base::TimeTicks::Now()); 1996 base::TimeTicks lower_bound_navigation_start(base::TimeTicks::Now());
1997 frame()->GetWebFrame()->loadHTMLString( 1997 frame()->GetWebFrame()->loadHTMLString(
1998 "hello world", blink::WebURL(GURL("data:text/html,"))); 1998 "hello world", blink::WebURL(GURL("data:text/html,")));
1999 1999
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
2564 ExpectPauseAndResume(3); 2564 ExpectPauseAndResume(3);
2565 blink::WebScriptSource source2( 2565 blink::WebScriptSource source2(
2566 WebString::fromUTF8("function func2() { func1(); }; func2();")); 2566 WebString::fromUTF8("function func2() { func1(); }; func2();"));
2567 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1); 2567 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1);
2568 2568
2569 EXPECT_FALSE(IsPaused()); 2569 EXPECT_FALSE(IsPaused());
2570 Detach(); 2570 Detach();
2571 } 2571 }
2572 2572
2573 } // namespace content 2573 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698