1// Copyright 2015 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.
4
5module content.mojom;
6
7import "mojo/public/mojom/base/shared_memory.mojom";
8
9interface TestService {
10  // Doesn't actually do anything, just responds.
11  DoSomething() => ();
12
13  // Terminates the current process to cause a connection error. Meant to test
14  // a connection error for the utility process.
15  DoTerminateProcess() => ();
16
17  // Crashes the current process. Meant to test that crash notifications are
18  // being sent correctly.
19  DoCrashImmediately() => ();
20
21  // Tries to create a temporary folder. Requires a sandbox to succeed.
22  CreateFolder() => (bool succeeded);
23
24  // Retrieve the requestor name as seen by the test app providing this service.
25  GetRequestorName() => (string name);
26
27  // Requests that a new read-only shared memory region be created and
28  // returned. On success, |region| is valid and its contents match |message|'s
29  // bytes exactly.
30  CreateReadOnlySharedMemoryRegion(string message)
31      => (mojo_base.mojom.ReadOnlySharedMemoryRegion? region);
32
33  // Requests that a new writable shared memory region be created and
34  // returned. On success, |region| is valid and its contents match |message|'s
35  // bytes exactly.
36  CreateWritableSharedMemoryRegion(string message)
37      => (mojo_base.mojom.WritableSharedMemoryRegion? region);
38
39  // Requests that a new unsafe shared memory region be created and returned.
40  // On success, |region| is valid and its contents match |message|'s bytes
41  // exactly.
42  CreateUnsafeSharedMemoryRegion(string message)
43      => (mojo_base.mojom.UnsafeSharedMemoryRegion? region);
44
45  // Returns the result of sandbox::policy::Sandbox::IsProcessSandboxed().
46  IsProcessSandboxed() => (bool is_sandboxed);
47};
48