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

Unified Diff: ios/chrome/browser/ui/omnibox_perftest.mm

Issue 2867593002: Enables omnibox_perftest that were failing. (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/omnibox_perftest.mm
diff --git a/ios/chrome/browser/ui/omnibox_perftest.mm b/ios/chrome/browser/ui/omnibox_perftest.mm
index 69e0b80f6bfdb438679675a321308da81decefcb..11400fd85b4a7973641531788825d601318ffdb3 100644
--- a/ios/chrome/browser/ui/omnibox_perftest.mm
+++ b/ios/chrome/browser/ui/omnibox_perftest.mm
@@ -20,6 +20,7 @@
#include "ios/chrome/browser/web_state_list/fake_web_state_list_delegate.h"
#include "ios/chrome/browser/web_state_list/web_state_list.h"
#include "ios/chrome/test/base/perf_test_ios.h"
+#include "ios/web/public/test/fakes/test_navigation_manager.h"
#include "ios/web/public/test/fakes/test_web_state.h"
#include "testing/platform_test.h"
#import "third_party/ocmock/OCMock/OCMock.h"
@@ -80,6 +81,9 @@ class OmniboxPerfTest : public PerfTest {
web_state_list_ = base::MakeUnique<WebStateList>(&web_state_list_delegate_);
std::unique_ptr<web::TestWebState> web_state =
base::MakeUnique<web::TestWebState>();
+ std::unique_ptr<web::TestNavigationManager> navigation_manager =
+ base::MakeUnique<web::TestNavigationManager>();
+ web_state->SetNavigationManager(std::move(navigation_manager));
web_state_list_->InsertWebState(0, std::move(web_state));
// Creates the Toolbar for testing and sizes it to the width of the screen.
@@ -91,10 +95,13 @@ class OmniboxPerfTest : public PerfTest {
// The OCMOCK_VALUE macro doesn't like std::unique_ptr, but it works just
// fine if a temporary variable is used.
ToolbarModelIOS* model_for_mock = toolbar_model_ios_.get();
+ web::WebState* web_state_for_mock = web_state_list_->GetWebStateAt(0);
id webToolbarDelegate =
[OCMockObject niceMockForProtocol:@protocol(WebToolbarDelegate)];
[[[webToolbarDelegate stub] andReturnValue:OCMOCK_VALUE(model_for_mock)]
toolbarModelIOS];
+ [[[webToolbarDelegate stub] andReturnValue:OCMOCK_VALUE(web_state_for_mock)]
+ currentWebState];
id urlLoader = [OCMockObject niceMockForProtocol:@protocol(UrlLoader)];
toolbar_ = [[WebToolbarController alloc]
initWithDelegate:webToolbarDelegate
@@ -233,8 +240,7 @@ TEST_F(OmniboxPerfTest, DISABLED_TestTextFieldDidBeginEditing) {
// Measures the amount of time it takes to type in the first character
// into the Omnibox.
-// TODO(crbug.com/717309): Test disabled because of nullptr dereferencing.
-TEST_F(OmniboxPerfTest, DISABLED_TestTypeOneCharInTextField) {
+TEST_F(OmniboxPerfTest, TestTypeOneCharInTextField) {
OmniboxTextFieldIOS* textField = (OmniboxTextFieldIOS*)FindViewByClass(
[toolbar_ view], [OmniboxTextFieldIOS class]);
RepeatTimedRuns("Type first character",
@@ -250,8 +256,7 @@ TEST_F(OmniboxPerfTest, DISABLED_TestTypeOneCharInTextField) {
// Measures the amount of time it takes to type in the word "google" one
// letter at a time.
-// TODO(crbug.com/717309): Test disabled because of nullptr dereferencing.
-TEST_F(OmniboxPerfTest, DISABLED_TestTypingInTextField) {
+TEST_F(OmniboxPerfTest, TestTypingInTextField) {
OmniboxTextFieldIOS* textField = (OmniboxTextFieldIOS*)FindViewByClass(
[toolbar_ view], [OmniboxTextFieldIOS class]);
// The characters to type into the omnibox text field.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698