Reland the ULONG -> SIZE_T change from 317177
[chromium-blink-merge.git] / extensions / browser / api / system_memory / system_memory_apitest.cc
blob40c1cfce91987885bbb8635f20a5108923be3dd6
1 // Copyright 2013 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 #include "base/message_loop/message_loop.h"
6 #include "extensions/browser/api/system_memory/memory_info_provider.h"
7 #include "extensions/shell/test/shell_apitest.h"
9 namespace extensions {
11 using core_api::system_memory::MemoryInfo;
13 class MockMemoryInfoProviderImpl : public MemoryInfoProvider {
14 public:
15 MockMemoryInfoProviderImpl() {}
17 bool QueryInfo() override {
18 info_.capacity = 4096;
19 info_.available_capacity = 1024;
20 return true;
23 private:
24 ~MockMemoryInfoProviderImpl() override {}
27 class SystemMemoryApiTest : public ShellApiTest {
28 public:
29 SystemMemoryApiTest() {}
30 ~SystemMemoryApiTest() override {}
32 void SetUpInProcessBrowserTestFixture() override {
33 ShellApiTest::SetUpInProcessBrowserTestFixture();
34 message_loop_.reset(new base::MessageLoopForUI);
37 private:
38 scoped_ptr<base::MessageLoop> message_loop_;
41 IN_PROC_BROWSER_TEST_F(SystemMemoryApiTest, Memory) {
42 scoped_refptr<MemoryInfoProvider> provider = new MockMemoryInfoProviderImpl();
43 // The provider is owned by the single MemoryInfoProvider instance.
44 MemoryInfoProvider::InitializeForTesting(provider);
45 ASSERT_TRUE(RunAppTest("system/memory")) << message_;
48 } // namespace extensions