Fix crash on app list start page keyboard navigation with <4 apps.
[chromium-blink-merge.git] / ios / chrome / test / testing_application_context.h
blob99e4cc9979ff6af88ee194f4c44b5541d3d8d638
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef IOS_CHROME_TEST_TESTING_APPLICATION_CONTEXT_H_
6 #define IOS_CHROME_TEST_TESTING_APPLICATION_CONTEXT_H_
8 #include "base/macros.h"
9 #include "base/threading/thread_checker.h"
10 #include "ios/chrome/browser/application_context.h"
12 class TestingApplicationContext : public ApplicationContext {
13 public:
14 TestingApplicationContext();
15 ~TestingApplicationContext() override;
17 // Convenience method to get the current application context as a
18 // TestingApplicationContext.
19 static TestingApplicationContext* GetGlobal();
21 // Sets the local state.
22 void SetLocalState(PrefService* local_state);
24 // ApplicationContext implementation.
25 PrefService* GetLocalState() override;
26 net::URLRequestContextGetter* GetSystemURLRequestContext() override;
27 const std::string& GetApplicationLocale() override;
29 private:
30 base::ThreadChecker thread_checker_;
31 std::string application_locale_;
32 PrefService* local_state_;
34 DISALLOW_COPY_AND_ASSIGN(TestingApplicationContext);
37 #endif // IOS_CHROME_TEST_TESTING_APPLICATION_CONTEXT_H_