| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ios/web/public/test/web_test.h" | 5 #include "ios/web/public/test/web_test.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "ios/web/public/active_state_manager.h" | 8 #include "ios/web/public/active_state_manager.h" |
| 9 #include "ios/web/public/web_state/global_web_state_observer.h" | 9 #include "ios/web/public/web_state/global_web_state_observer.h" |
| 10 #import "ios/web/public/test/fakes/test_web_client.h" | 10 #import "ios/web/public/test/fakes/test_web_client.h" |
| 11 | 11 |
| 12 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 13 #error "This file requires ARC support." |
| 14 #endif |
| 15 |
| 12 namespace web { | 16 namespace web { |
| 13 | 17 |
| 14 class WebTestRenderProcessCrashObserver : public GlobalWebStateObserver { | 18 class WebTestRenderProcessCrashObserver : public GlobalWebStateObserver { |
| 15 public: | 19 public: |
| 16 WebTestRenderProcessCrashObserver() = default; | 20 WebTestRenderProcessCrashObserver() = default; |
| 17 ~WebTestRenderProcessCrashObserver() override = default; | 21 ~WebTestRenderProcessCrashObserver() override = default; |
| 18 | 22 |
| 19 void RenderProcessGone(WebState* web_state) override { | 23 void RenderProcessGone(WebState* web_state) override { |
| 20 FAIL() << "Renderer process died unexpectedly during the test"; | 24 FAIL() << "Renderer process died unexpectedly during the test"; |
| 21 } | 25 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 47 | 51 |
| 48 void WebTest::SetIgnoreRenderProcessCrashesDuringTesting(bool allow) { | 52 void WebTest::SetIgnoreRenderProcessCrashesDuringTesting(bool allow) { |
| 49 if (allow) { | 53 if (allow) { |
| 50 crash_observer_ = nullptr; | 54 crash_observer_ = nullptr; |
| 51 } else { | 55 } else { |
| 52 crash_observer_ = base::MakeUnique<WebTestRenderProcessCrashObserver>(); | 56 crash_observer_ = base::MakeUnique<WebTestRenderProcessCrashObserver>(); |
| 53 } | 57 } |
| 54 } | 58 } |
| 55 | 59 |
| 56 } // namespace web | 60 } // namespace web |
| OLD | NEW |