| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "athena/test/chrome/athena_app_browsertest.h" | 5 #include "athena/test/chrome/athena_app_browsertest.h" |
| 6 | 6 |
| 7 #include "athena/extensions/public/extensions_delegate.h" | 7 #include "athena/extensions/public/extensions_delegate.h" |
| 8 #include "athena/test/base/activity_lifetime_tracker.h" | 8 #include "athena/test/base/activity_lifetime_tracker.h" |
| 9 #include "athena/test/chrome/test_util.h" | 9 #include "athena/test/chrome/test_util.h" |
| 10 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
| 11 #include "content/public/common/content_switches.h" |
| 11 #include "content/public/test/test_utils.h" | 12 #include "content/public/test/test_utils.h" |
| 12 | 13 |
| 13 namespace athena { | 14 namespace athena { |
| 14 | 15 |
| 15 namespace { | |
| 16 const char kNoNaclSandbox[] = "--no-sandbox"; | |
| 17 } | |
| 18 | |
| 19 AthenaAppBrowserTest::AthenaAppBrowserTest() { | 16 AthenaAppBrowserTest::AthenaAppBrowserTest() { |
| 20 } | 17 } |
| 21 | 18 |
| 22 AthenaAppBrowserTest::~AthenaAppBrowserTest() { | 19 AthenaAppBrowserTest::~AthenaAppBrowserTest() { |
| 23 } | 20 } |
| 24 | 21 |
| 25 void AthenaAppBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { | 22 void AthenaAppBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { |
| 26 // The NaCl sandbox won't work in our browser tests. | 23 // The NaCl sandbox won't work in our browser tests. |
| 27 command_line->AppendSwitch(kNoNaclSandbox); | 24 command_line->AppendSwitch(switches::kNoSandbox); |
| 28 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); | 25 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); |
| 29 } | 26 } |
| 30 | 27 |
| 31 Activity* AthenaAppBrowserTest::CreateTestAppActivity( | 28 Activity* AthenaAppBrowserTest::CreateTestAppActivity( |
| 32 const std::string app_id) { | 29 const std::string app_id) { |
| 33 ActivityLifetimeTracker tracker; | 30 ActivityLifetimeTracker tracker; |
| 34 | 31 |
| 35 test_util::WaitUntilIdle(); | 32 test_util::WaitUntilIdle(); |
| 36 content::WindowedNotificationObserver observer( | 33 content::WindowedNotificationObserver observer( |
| 37 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 34 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 55 return app_id_; | 52 return app_id_; |
| 56 } | 53 } |
| 57 | 54 |
| 58 void AthenaAppBrowserTest::SetUpOnMainThread() { | 55 void AthenaAppBrowserTest::SetUpOnMainThread() { |
| 59 // Set the memory pressure to low and turning off undeterministic resource | 56 // Set the memory pressure to low and turning off undeterministic resource |
| 60 // observer events. | 57 // observer events. |
| 61 test_util::SendTestMemoryPressureEvent(ResourceManager::MEMORY_PRESSURE_LOW); | 58 test_util::SendTestMemoryPressureEvent(ResourceManager::MEMORY_PRESSURE_LOW); |
| 62 } | 59 } |
| 63 | 60 |
| 64 } // namespace athena | 61 } // namespace athena |
| OLD | NEW |