android: fix executable name test

Bug: chromium:1050178
Change-Id: I04ba3e4c4b3d2c707a9967b792a2e8d85e62adef
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2317841
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Joshua Peraza 2020-07-24 16:28:16 -07:00 committed by Commit Bot
parent f9549d1ffe
commit ad3ad354d3

View File

@ -28,6 +28,7 @@
#include "gtest/gtest.h"
#include "snapshot/elf/elf_image_reader.h"
#include "test/linux/fake_ptrace_connection.h"
#include "test/main_arguments.h"
#include "test/multiprocess.h"
#include "util/linux/address_types.h"
#include "util/linux/auxiliary_vector.h"
@ -89,8 +90,8 @@ void TestAgainstTarget(PtraceConnection* connection) {
const int android_runtime_api = android_get_device_api_level();
ASSERT_GE(android_runtime_api, 1);
EXPECT_NE(debug.Executable()->name.find("crashpad_snapshot_test"),
std::string::npos);
base::FilePath exe_name(base::FilePath(GetMainArguments()[0]).BaseName());
EXPECT_NE(debug.Executable()->name.find(exe_name.value()), std::string::npos);
// Android's loader doesn't set the dynamic array for the executable in the
// link map until Android 10.0 (API 29).