diff options
author | Colin Cross <ccross@android.com> | 2022-04-13 00:39:09 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-04-13 00:39:09 +0000 |
commit | 798f3afdf6be88186e79048e6abb39e3aaa6f4df (patch) | |
tree | 2ce94d7f0804ccb77d1fa9b2a1bca00eecdff1e2 /third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc | |
parent | 7d5c00bbb9ff7b14de493bfa0ea56d4993f2e187 (diff) | |
parent | 36ccdba805f1322c23714dbeb227fb632b54ae45 (diff) | |
download | webrtc-798f3afdf6be88186e79048e6abb39e3aaa6f4df.tar.gz |
Merge changes I0ab600cd,I1e74c64a
* changes:
Update webrtc's abseil-cpp
Remove alsa and pulseaudio sources
Diffstat (limited to 'third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc')
-rw-r--r-- | third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc b/third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc index 7abbbf9c59..31abb888a6 100644 --- a/third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc +++ b/third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc @@ -21,6 +21,12 @@ #include <unordered_map> #include <utility> +#ifdef __EMSCRIPTEN__ +#include <emscripten.h> +#endif + +#include "absl/container/node_hash_map.h" + namespace absl { ABSL_NAMESPACE_BEGIN namespace base_internal { @@ -75,7 +81,7 @@ static bool using_low_level_alloc = false; // allocations and deallocations are reported via the MallocHook // interface. static void Test(bool use_new_arena, bool call_malloc_hook, int n) { - typedef std::unordered_map<int, BlockDesc> AllocMap; + typedef absl::node_hash_map<int, BlockDesc> AllocMap; AllocMap allocated; AllocMap::iterator it; BlockDesc block_desc; @@ -156,5 +162,20 @@ ABSL_NAMESPACE_END int main(int argc, char *argv[]) { // The actual test runs in the global constructor of `before_main`. printf("PASS\n"); +#ifdef __EMSCRIPTEN__ + // clang-format off +// This is JS here. Don't try to format it. + MAIN_THREAD_EM_ASM({ + if (ENVIRONMENT_IS_WEB) { + if (typeof TEST_FINISH === 'function') { + TEST_FINISH($0); + } else { + console.error('Attempted to exit with status ' + $0); + console.error('But TEST_FINSIHED is not a function.'); + } + } + }, 0); +// clang-format on +#endif return 0; } |