| 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 package org.chromium.chromium_linker_test_apk; | 5 package org.chromium.chromium_linker_test_apk; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.content.Intent; | 9 import android.content.Intent; |
| 10 import android.os.Bundle; | 10 import android.os.Bundle; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 if (hasLowMemoryDeviceSwitch) | 78 if (hasLowMemoryDeviceSwitch) |
| 79 memoryDeviceConfig = Linker.MEMORY_DEVICE_CONFIG_LOW; | 79 memoryDeviceConfig = Linker.MEMORY_DEVICE_CONFIG_LOW; |
| 80 Linker.setMemoryDeviceConfig(memoryDeviceConfig); | 80 Linker.setMemoryDeviceConfig(memoryDeviceConfig); |
| 81 | 81 |
| 82 // Register the test runner class by name. | 82 // Register the test runner class by name. |
| 83 Linker.setTestRunnerClassName(LinkerTests.class.getName()); | 83 Linker.setTestRunnerClassName(LinkerTests.class.getName()); |
| 84 | 84 |
| 85 // Load the library in the browser process, this will also run the test | 85 // Load the library in the browser process, this will also run the test |
| 86 // runner in this process. | 86 // runner in this process. |
| 87 try { | 87 try { |
| 88 LibraryLoader.ensureInitialized(null); | 88 LibraryLoader.ensureInitialized(); |
| 89 } catch (ProcessInitException e) { | 89 } catch (ProcessInitException e) { |
| 90 Log.i(TAG, "Cannot load chromium_linker_test:" + e); | 90 Log.i(TAG, "Cannot load chromium_linker_test:" + e); |
| 91 } | 91 } |
| 92 | 92 |
| 93 // Now, start a new renderer process by creating a new view. | 93 // Now, start a new renderer process by creating a new view. |
| 94 // This will run the test runner in the renderer process. | 94 // This will run the test runner in the renderer process. |
| 95 | 95 |
| 96 BrowserStartupController.get(getApplicationContext()).initChromiumBrowse
rProcessForTests(); | 96 BrowserStartupController.get(getApplicationContext()).initChromiumBrowse
rProcessForTests(); |
| 97 | 97 |
| 98 LayoutInflater inflater = | 98 LayoutInflater inflater = |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 if (mShellManager == null) | 185 if (mShellManager == null) |
| 186 return null; | 186 return null; |
| 187 | 187 |
| 188 Shell shell = mShellManager.getActiveShell(); | 188 Shell shell = mShellManager.getActiveShell(); |
| 189 if (shell == null) | 189 if (shell == null) |
| 190 return null; | 190 return null; |
| 191 | 191 |
| 192 return shell.getContentView(); | 192 return shell.getContentView(); |
| 193 } | 193 } |
| 194 } | 194 } |
| OLD | NEW |