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

Side by Side Diff: components/omnibox/browser/autocomplete_provider_unittest.cc

Issue 2818533003: Make nesting/running states a RunLoop rather than a MessageLoop concept. (Closed)
Patch Set: still need to check MessageLoop::current() in Mojo's RunLoopNestingObserver::GetForThread() 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 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 "components/omnibox/browser/autocomplete_provider.h" 5 #include "components/omnibox/browser/autocomplete_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 public: 67 public:
68 AutocompleteProviderClientWithClosure() {} 68 AutocompleteProviderClientWithClosure() {}
69 69
70 void set_closure(const base::Closure& closure) { closure_ = closure; } 70 void set_closure(const base::Closure& closure) { closure_ = closure; }
71 71
72 private: 72 private:
73 void OnAutocompleteControllerResultReady( 73 void OnAutocompleteControllerResultReady(
74 AutocompleteController* controller) override { 74 AutocompleteController* controller) override {
75 if (!closure_.is_null()) 75 if (!closure_.is_null())
76 closure_.Run(); 76 closure_.Run();
77 if (base::MessageLoop::current()->is_running()) 77 if (base::RunLoop::IsRunningOnCurrentThread())
78 base::MessageLoop::current()->QuitWhenIdle(); 78 base::MessageLoop::current()->QuitWhenIdle();
79 } 79 }
80 80
81 base::Closure closure_; 81 base::Closure closure_;
82 82
83 DISALLOW_COPY_AND_ASSIGN(AutocompleteProviderClientWithClosure); 83 DISALLOW_COPY_AND_ASSIGN(AutocompleteProviderClientWithClosure);
84 }; 84 };
85 85
86 } // namespace 86 } // namespace
87 87
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 EXPECT_FALSE(search_provider_field_trial_triggered_in_session()); 764 EXPECT_FALSE(search_provider_field_trial_triggered_in_session());
765 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); 765 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456));
766 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j0j4&", url.path()); 766 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j0j4&", url.path());
767 767
768 // Test page classification and field trial triggered set. 768 // Test page classification and field trial triggered set.
769 set_search_provider_field_trial_triggered_in_session(true); 769 set_search_provider_field_trial_triggered_in_session(true);
770 EXPECT_TRUE(search_provider_field_trial_triggered_in_session()); 770 EXPECT_TRUE(search_provider_field_trial_triggered_in_session());
771 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); 771 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456));
772 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j1j4&", url.path()); 772 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j1j4&", url.path());
773 } 773 }
OLDNEW
« no previous file with comments | « chromeos/dbus/services/service_provider_test_helper.cc ('k') | components/sync/engine_impl/sync_scheduler_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698